pub trait CeilingLogBasePowerOf2<POW> {
    type Output;

    fn ceiling_log_base_power_of_2(self, pow: POW) -> Self::Output;
}
Expand description

Calculates the ceiling of the base-$2^k$ logarithm of a number.

Required Associated Types

Required Methods

Implementations on Foreign Types

Returns the ceiling of the base-$2^k$ logarithm of a positive integer.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self is infinite, NaN, or less than or equal to zero, or if pow is zero.

Examples

See here.

Returns the ceiling of the base-$2^k$ logarithm of a positive integer.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self is infinite, NaN, or less than or equal to zero, or if pow is zero.

Examples

See here.

Returns the ceiling of the base-$2^k$ logarithm of a positive integer.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self is infinite, NaN, or less than or equal to zero, or if pow is zero.

Examples

See here.

Returns the ceiling of the base-$2^k$ logarithm of a positive integer.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self is infinite, NaN, or less than or equal to zero, or if pow is zero.

Examples

See here.

Returns the ceiling of the base-$2^k$ logarithm of a positive integer.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self is infinite, NaN, or less than or equal to zero, or if pow is zero.

Examples

See here.

Returns the ceiling of the base-$2^k$ logarithm of a positive integer.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self is infinite, NaN, or less than or equal to zero, or if pow is zero.

Examples

See here.

Returns the ceiling of the base-$2^k$ logarithm of a positive float.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self or pow are 0.

Examples

See here.

Returns the ceiling of the base-$2^k$ logarithm of a positive float.

$f(x, k) = \lceil\log_{2^k} x\rceil$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if self or pow are 0.

Examples

See here.

Implementors