Trait int_traits::IntTraits
[−]
[src]
pub trait IntTraits<T: Sized> where
Self: Sized, { fn sqrt(self) -> T; fn cbrt(self) -> T; fn log(self, n: u64) -> T; fn log10(self) -> T { ... } fn log2(self) -> T { ... } }
Provides functions which extended the class methods on integers.
Required Methods
fn sqrt(self) -> T
fn cbrt(self) -> T
fn log(self, n: u64) -> T
Returns the floored logarithm of n
.
The logarithm must be of integer base. This is to avoid unnecessary casts and is purely ergonomic.
Panics
Panics if n
<= 0.