pub trait FixedPoint: Sized + Copy {
type T: TimeInt;
const SCALING_FACTOR: Fraction;
// Required method
fn integer(&self) -> Self::T;
// Provided methods
fn checked_mul(&self, rhs: &Self::T) -> Option<Self> { ... }
fn checked_div(&self, rhs: &Self::T) -> Option<Self> { ... }
fn min_value() -> Self::T { ... }
fn max_value() -> Self::T { ... }
}
Expand description
Fixed-point value type
QX.32 where X: bit-width of T
Required Associated Constants§
Sourceconst SCALING_FACTOR: Fraction
const SCALING_FACTOR: Fraction
The fractional scaling factor
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn checked_mul(&self, rhs: &Self::T) -> Option<Self>
fn checked_mul(&self, rhs: &Self::T) -> Option<Self>
Multiply with overflow checking
Sourcefn checked_div(&self, rhs: &Self::T) -> Option<Self>
fn checked_div(&self, rhs: &Self::T) -> Option<Self>
Multiply with overflow checking
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.