Trait FixedPointInfo

Source
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 its DIV value. Used to compute underflow thresholds and convergence bounds in fixed_exp and 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§

Source

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.

Source

const DECIMAL_PLACES: u32

Number of representable decimal places, equal to log10(DIV).

TypeDIVDECIMAL_PLACES
FixedU6410^99
FixedI6410^99
FixedU12810^1818
FixedI12810^1818

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.

Source§

const INNER_BITS: u32 = 64u32

Source§

const DECIMAL_PLACES: u32 = 9u32

Source§

impl FixedPointInfo for FixedI128

FixedI128: inner type i128 (128-bit), DIV = 10^18 - 18 decimal places.

Source§

const INNER_BITS: u32 = 128u32

Source§

const DECIMAL_PLACES: u32 = 18u32

Source§

impl FixedPointInfo for FixedU64

FixedU64: inner type u64 (64-bit), DIV = 10^9 - 9 decimal places.

Source§

const INNER_BITS: u32 = 64u32

Source§

const DECIMAL_PLACES: u32 = 9u32

Source§

impl FixedPointInfo for FixedU128

FixedU128: inner type u128 (128-bit), DIV = 10^18 - 18 decimal places.

Source§

const INNER_BITS: u32 = 128u32

Source§

const DECIMAL_PLACES: u32 = 18u32

Implementors§