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

Takes the floored square root of a number.

Panics

Panics if n is negative.

Takes the floored cubic root of a number.

Panics

Panics if n is negative.

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.

Provided Methods

Returns the floored base 10 logarithm of n.

Panics

Panics if n <= 0.

Returns the floored base 10 logarithm of n.

Panics

Panics if n <= 0.

Implementors