pub trait FixedPointOps<const DECIMALS: u8>: MulDiv + Num {
const UNIT: Self;
// Required method
fn checked_pow_fixed(&self, exponent: &Self) -> Option<Self>;
}Expand description
Number type with the required properties for implementing Fixed.
Required Associated Constants§
Required Methods§
Sourcefn checked_pow_fixed(&self, exponent: &Self) -> Option<Self>
fn checked_pow_fixed(&self, exponent: &Self) -> Option<Self>
Fixed point power.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<const DECIMALS: u8> FixedPointOps<DECIMALS> for u64
impl<const DECIMALS: u8> FixedPointOps<DECIMALS> for u64
Source§fn checked_pow_fixed(&self, exponent: &Self) -> Option<Self>
fn checked_pow_fixed(&self, exponent: &Self) -> Option<Self>
Fixed point power.
§Notes
The code that calculates exponents behaves inconsistently depending on whether the exponent is a whole unit or not. Therefore, to avoid issues, we should use only unit exponents until we implement better algorithms.
const UNIT: Self
Source§impl<const DECIMALS: u8> FixedPointOps<DECIMALS> for u128
Available on crate feature u128 only.
impl<const DECIMALS: u8> FixedPointOps<DECIMALS> for u128
Available on crate feature
u128 only.Source§fn checked_pow_fixed(&self, exponent: &Self) -> Option<Self>
fn checked_pow_fixed(&self, exponent: &Self) -> Option<Self>
Fixed point power.
§Notes
The code that calculates exponents behaves inconsistently depending on whether the exponent is a whole unit or not. Therefore, to avoid issues, we should use only unit exponents until we implement better algorithms.