pub trait FixedPointInfo {
const INNER_BITS: u32;
const DECIMAL_PLACES: u32;
}Expand description
Provides precision metadata for fixed-point types used in numerical series computations.
§Constants
DECIMAL_PLACES: the number of decimal digits after the point that the type can represent, derived from itsDIVvalue. Used to compute underflow thresholds and convergence bounds infixed_expand related functions.
§Note
These types use decimal fixed-point representation, not binary.
DIV is a power of 10, so precision is measured in decimal places
rather than fractional bits. INNER_BITS records the total bit width
of the underlying integer storage and is reserved for potential future
use with binary fixed-point types; it is not used internally.
Required Associated Constants§
Sourceconst INNER_BITS: u32
const INNER_BITS: u32
Total bit width of the inner integer storage type.
For example, FixedU64 wraps a u64, so INNER_BITS = 64.
This constant is reserved for potential future binary fixed-point support and is not used internally.
Sourceconst DECIMAL_PLACES: u32
const DECIMAL_PLACES: u32
Number of representable decimal places, equal to log10(DIV).
| Type | DIV | DECIMAL_PLACES |
|---|---|---|
FixedU64 | 10^9 | 9 |
FixedI64 | 10^9 | 9 |
FixedU128 | 10^18 | 18 |
FixedI128 | 10^18 | 18 |
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.
Implementations on Foreign Types§
Source§impl FixedPointInfo for FixedI64
FixedI64: inner type i64 (64-bit), DIV = 10^9 - 9 decimal places.
impl FixedPointInfo for FixedI64
FixedI64: inner type i64 (64-bit), DIV = 10^9 - 9 decimal places.
const INNER_BITS: u32 = 64u32
const DECIMAL_PLACES: u32 = 9u32
Source§impl FixedPointInfo for FixedI128
FixedI128: inner type i128 (128-bit), DIV = 10^18 - 18 decimal places.
impl FixedPointInfo for FixedI128
FixedI128: inner type i128 (128-bit), DIV = 10^18 - 18 decimal places.
const INNER_BITS: u32 = 128u32
const DECIMAL_PLACES: u32 = 18u32
Source§impl FixedPointInfo for FixedU64
FixedU64: inner type u64 (64-bit), DIV = 10^9 - 9 decimal places.
impl FixedPointInfo for FixedU64
FixedU64: inner type u64 (64-bit), DIV = 10^9 - 9 decimal places.
const INNER_BITS: u32 = 64u32
const DECIMAL_PLACES: u32 = 9u32
Source§impl FixedPointInfo for FixedU128
FixedU128: inner type u128 (128-bit), DIV = 10^18 - 18 decimal places.
impl FixedPointInfo for FixedU128
FixedU128: inner type u128 (128-bit), DIV = 10^18 - 18 decimal places.