[−][src]Trait fixed::traits::FixedUnsigned
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.
Implementors
impl<Frac> FixedUnsigned for FixedU128<Frac> where
Frac: Unsigned + IsLessOrEqual<U128, Output = True>,
[src]
Frac: Unsigned + IsLessOrEqual<U128, Output = True>,
fn is_power_of_two(self) -> bool
[src]
fn next_power_of_two(self) -> Self
[src]
fn checked_next_power_of_two(self) -> Option<Self>
[src]
impl<Frac> FixedUnsigned for FixedU16<Frac> where
Frac: Unsigned + IsLessOrEqual<U16, Output = True>,
[src]
Frac: Unsigned + IsLessOrEqual<U16, Output = True>,
fn is_power_of_two(self) -> bool
[src]
fn next_power_of_two(self) -> Self
[src]
fn checked_next_power_of_two(self) -> Option<Self>
[src]
impl<Frac> FixedUnsigned for FixedU32<Frac> where
Frac: Unsigned + IsLessOrEqual<U32, Output = True>,
[src]
Frac: Unsigned + IsLessOrEqual<U32, Output = True>,
fn is_power_of_two(self) -> bool
[src]
fn next_power_of_two(self) -> Self
[src]
fn checked_next_power_of_two(self) -> Option<Self>
[src]
impl<Frac> FixedUnsigned for FixedU64<Frac> where
Frac: Unsigned + IsLessOrEqual<U64, Output = True>,
[src]
Frac: Unsigned + IsLessOrEqual<U64, Output = True>,
fn is_power_of_two(self) -> bool
[src]
fn next_power_of_two(self) -> Self
[src]
fn checked_next_power_of_two(self) -> Option<Self>
[src]
impl<Frac> FixedUnsigned for FixedU8<Frac> where
Frac: Unsigned + IsLessOrEqual<U8, Output = True>,
[src]
Frac: Unsigned + IsLessOrEqual<U8, Output = True>,