pub trait FixedForInteger {
type FixedPoint: FixedPointNumber;
}Expand description
Trait mapping primitive integer types to an appropriate fixed-point type.
This is useful in generic algorithms where a numeric type might need to be converted to a fixed-point representation for deterministic arithmetic, scaling, or computations.
Required Associated Types§
Sourcetype FixedPoint: FixedPointNumber
type FixedPoint: FixedPointNumber
The fixed-point type corresponding to the integer type.
- Small unsigned integers (u8, u16, u32) map to
FixedU64 - Large unsigned integers (u64, u128, usize) map to
FixedU128 - Signed integers follow a similar mapping with
FixedI64orFixedI128.