pub trait LogOf<T> {
// Required methods
fn log_of(argument: T) -> Result<Self>
where Self: Sized;
fn n_log_n_of(argument: T) -> Result<Self>
where Self: Sized;
}Required Methods§
Sourcefn log_of(argument: T) -> Result<Self>where
Self: Sized,
fn log_of(argument: T) -> Result<Self>where
Self: Sized,
Returns the 2-logarithm of the given argument: log_2(argument). Returns an error if the argument is not positive.
This is a potentially expensive operation, as the prime factors of the argument may be computed. May return an error if the argument is too large, that is, for now, cannot be represented by an u128.
If a multiplication with argument is foreseen, then the n_log_n function is more efficient.
Sourcefn n_log_n_of(argument: T) -> Result<Self>where
Self: Sized,
fn n_log_n_of(argument: T) -> Result<Self>where
Self: Sized,
Returns the value argument * log_2(argument). Returns an error if the argument is not positive.
This is a potentially expensive operation, as the prime factors of the argument may be computed. May return an error if the argument is too large, that is, for now, cannot be represented by an u128.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".