[][src]Trait fixed::traits::FixedUnsigned

pub trait FixedUnsigned: Fixed {
    fn is_power_of_two(self) -> bool;
fn next_power_of_two(self) -> Self;
fn checked_next_power_of_two(self) -> Option<Self>; }

This trait provides common methods to all unsigned fixed-point numbers.

Required methods

fn is_power_of_two(self) -> bool

Returns true if the fixed-point number is 2k for some integer k.

fn next_power_of_two(self) -> Self

Returns the smallest power of two ≥ self.

fn checked_next_power_of_two(self) -> Option<Self>

Returns the smallest power of two ≥ self, or None if the next power of two is too large to represent.

Loading content...

Implementors

impl<Frac> FixedUnsigned for FixedU128<Frac> where
    Frac: Unsigned + IsLessOrEqual<U128, Output = True>, 
[src]

impl<Frac> FixedUnsigned for FixedU16<Frac> where
    Frac: Unsigned + IsLessOrEqual<U16, Output = True>, 
[src]

impl<Frac> FixedUnsigned for FixedU32<Frac> where
    Frac: Unsigned + IsLessOrEqual<U32, Output = True>, 
[src]

impl<Frac> FixedUnsigned for FixedU64<Frac> where
    Frac: Unsigned + IsLessOrEqual<U64, Output = True>, 
[src]

impl<Frac> FixedUnsigned for FixedU8<Frac> where
    Frac: Unsigned + IsLessOrEqual<U8, Output = True>, 
[src]

Loading content...