Skip to main content

LogOf

Trait LogOf 

Source
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§

Source

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.

Source

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".

Implementors§

Source§

impl LogOf<&FractionEnum> for LogPolynomialEnum

Source§

impl LogOf<&FractionExact> for LogPolynomialExact

Source§

impl LogOf<&FractionF64> for LogPolynomialF64

Source§

impl LogOf<&Natural> for LogPolynomialExact

Source§

impl LogOf<&Rational> for LogPolynomialExact

Source§

impl LogOf<&i8> for LogPolynomialEnum

Source§

impl LogOf<&i8> for LogPolynomialExact

Source§

impl LogOf<&i8> for LogPolynomialF64

Source§

impl LogOf<&i16> for LogPolynomialEnum

Source§

impl LogOf<&i16> for LogPolynomialExact

Source§

impl LogOf<&i16> for LogPolynomialF64

Source§

impl LogOf<&i32> for LogPolynomialEnum

Source§

impl LogOf<&i32> for LogPolynomialExact

Source§

impl LogOf<&i32> for LogPolynomialF64

Source§

impl LogOf<&i64> for LogPolynomialEnum

Source§

impl LogOf<&i64> for LogPolynomialExact

Source§

impl LogOf<&i64> for LogPolynomialF64

Source§

impl LogOf<&i128> for LogPolynomialEnum

Source§

impl LogOf<&i128> for LogPolynomialExact

Source§

impl LogOf<&i128> for LogPolynomialF64

Source§

impl LogOf<&u8> for LogPolynomialEnum

Source§

impl LogOf<&u8> for LogPolynomialExact

Source§

impl LogOf<&u8> for LogPolynomialF64

Source§

impl LogOf<&u16> for LogPolynomialEnum

Source§

impl LogOf<&u16> for LogPolynomialExact

Source§

impl LogOf<&u16> for LogPolynomialF64

Source§

impl LogOf<&u32> for LogPolynomialEnum

Source§

impl LogOf<&u32> for LogPolynomialExact

Source§

impl LogOf<&u32> for LogPolynomialF64

Source§

impl LogOf<&u64> for LogPolynomialEnum

Source§

impl LogOf<&u64> for LogPolynomialExact

Source§

impl LogOf<&u64> for LogPolynomialF64

Source§

impl LogOf<&usize> for LogPolynomialEnum

Source§

impl LogOf<&usize> for LogPolynomialExact

Source§

impl LogOf<&usize> for LogPolynomialF64

Source§

impl LogOf<FractionEnum> for LogPolynomialEnum

Source§

impl LogOf<FractionExact> for LogPolynomialExact

Source§

impl LogOf<FractionF64> for LogPolynomialF64

Source§

impl LogOf<f64> for LogPolynomialF64

Source§

impl LogOf<i8> for LogPolynomialEnum

Source§

impl LogOf<i8> for LogPolynomialExact

Source§

impl LogOf<i8> for LogPolynomialF64

Source§

impl LogOf<i16> for LogPolynomialEnum

Source§

impl LogOf<i16> for LogPolynomialExact

Source§

impl LogOf<i16> for LogPolynomialF64

Source§

impl LogOf<i32> for LogPolynomialEnum

Source§

impl LogOf<i32> for LogPolynomialExact

Source§

impl LogOf<i32> for LogPolynomialF64

Source§

impl LogOf<i64> for LogPolynomialEnum

Source§

impl LogOf<i64> for LogPolynomialExact

Source§

impl LogOf<i64> for LogPolynomialF64

Source§

impl LogOf<i128> for LogPolynomialEnum

Source§

impl LogOf<i128> for LogPolynomialExact

Source§

impl LogOf<i128> for LogPolynomialF64

Source§

impl LogOf<u8> for LogPolynomialEnum

Source§

impl LogOf<u8> for LogPolynomialExact

Source§

impl LogOf<u8> for LogPolynomialF64

Source§

impl LogOf<u16> for LogPolynomialEnum

Source§

impl LogOf<u16> for LogPolynomialExact

Source§

impl LogOf<u16> for LogPolynomialF64

Source§

impl LogOf<u32> for LogPolynomialEnum

Source§

impl LogOf<u32> for LogPolynomialExact

Source§

impl LogOf<u32> for LogPolynomialF64

Source§

impl LogOf<u64> for LogPolynomialEnum

Source§

impl LogOf<u64> for LogPolynomialExact

Source§

impl LogOf<u64> for LogPolynomialF64

Source§

impl LogOf<u128> for LogPolynomialExact

Source§

impl LogOf<usize> for LogPolynomialEnum

Source§

impl LogOf<usize> for LogPolynomialExact

Source§

impl LogOf<usize> for LogPolynomialF64