pub trait FloorLogBase<B = Self> {
    type Output;

    fn floor_log_base(self, base: B) -> Self::Output;
}
Expand description

Calculates the floor of the base-$b$ logarithm of a number.

Required Associated Types

Required Methods

Implementations on Foreign Types

Returns the floor of the base-$b$ logarithm of a positive integer.

$f(x, b) = \lfloor\log_b x\rfloor$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits() / base.significant_bits().

Panics

Panics if self is 0 or base is less than 2.

Examples

See here.

Returns the floor of the base-$b$ logarithm of a positive integer.

$f(x, b) = \lfloor\log_b x\rfloor$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits() / base.significant_bits().

Panics

Panics if self is 0 or base is less than 2.

Examples

See here.

Returns the floor of the base-$b$ logarithm of a positive integer.

$f(x, b) = \lfloor\log_b x\rfloor$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits() / base.significant_bits().

Panics

Panics if self is 0 or base is less than 2.

Examples

See here.

Returns the floor of the base-$b$ logarithm of a positive integer.

$f(x, b) = \lfloor\log_b x\rfloor$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits() / base.significant_bits().

Panics

Panics if self is 0 or base is less than 2.

Examples

See here.

Returns the floor of the base-$b$ logarithm of a positive integer.

$f(x, b) = \lfloor\log_b x\rfloor$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits() / base.significant_bits().

Panics

Panics if self is 0 or base is less than 2.

Examples

See here.

Returns the floor of the base-$b$ logarithm of a positive integer.

$f(x, b) = \lfloor\log_b x\rfloor$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits() / base.significant_bits().

Panics

Panics if self is 0 or base is less than 2.

Examples

See here.

Implementors