Trait mycelium_util::math::Logarithm
source · pub trait Logarithm: Sized {
// Required methods
fn log2_ceil(self) -> Self;
fn log2(self) -> Self;
fn checked_log(self, base: Self) -> Option<Self>;
fn log(self, base: Self) -> Self;
}
Expand description
Extension trait adding logarithm methods to integers.
Required Methods§
sourcefn checked_log(self, base: Self) -> Option<Self>
fn checked_log(self, base: Self) -> Option<Self>
Returns the integer logarithm base base
of self
, or None
if it is
not possible to take the log base base
of self
.
Object Safety§
This trait is not object safe.