#[doc(hidden)]pub trait Lemire: FloatExt {
const MAX_EXPONENT_FAST_PATH: i64 = _;
const MIN_EXPONENT_FAST_PATH: i64 = _;
const MAX_EXPONENT_DISGUISED_FAST_PATH: i64 = _;
const MAX_MANTISSA_FAST_PATH: u64 = _;
// Required methods
fn pow10_fast_path(exponent: usize) -> Self;
fn from_u64(v: u64) -> Self;
}dec2flt)Expand description
Extension to Float that are necessary for parsing using the Lemire method.
See the parent module’s doc comment for why this is necessary.
Not intended for use outside of the dec2flt module.
Provided Associated Constants§
Sourceconst MAX_EXPONENT_FAST_PATH: i64 = _
🔬This is a nightly-only experimental API. (dec2flt)
const MAX_EXPONENT_FAST_PATH: i64 = _
dec2flt)Maximum exponent for a fast path case, or ⌊(SIG_BITS+1)/log2(5)⌋
Sourceconst MIN_EXPONENT_FAST_PATH: i64 = _
🔬This is a nightly-only experimental API. (dec2flt)
const MIN_EXPONENT_FAST_PATH: i64 = _
dec2flt)Minimum exponent for a fast path case, or -⌊(SIG_BITS+1)/log2(5)⌋
Sourceconst MAX_EXPONENT_DISGUISED_FAST_PATH: i64 = _
🔬This is a nightly-only experimental API. (dec2flt)
const MAX_EXPONENT_DISGUISED_FAST_PATH: i64 = _
dec2flt)Maximum exponent that can be represented for a disguised-fast path case.
This is MAX_EXPONENT_FAST_PATH + ⌊(SIG_BITS+1)/log2(10)⌋
Sourceconst MAX_MANTISSA_FAST_PATH: u64 = _
🔬This is a nightly-only experimental API. (dec2flt)
const MAX_MANTISSA_FAST_PATH: u64 = _
dec2flt)Maximum mantissa for the fast-path (1 << 53 for f64).
Required Methods§
Sourcefn pow10_fast_path(exponent: usize) -> Self
🔬This is a nightly-only experimental API. (dec2flt)
fn pow10_fast_path(exponent: usize) -> Self
dec2flt)Gets a small power-of-ten for fast-path multiplication.
Sourcefn from_u64(v: u64) -> Self
🔬This is a nightly-only experimental API. (dec2flt)
fn from_u64(v: u64) -> Self
dec2flt)Converts integer into float through an as cast. This is only called in the fast-path algorithm, and therefore will not lose precision, since the value will always have only if the value is <= Self::MAX_MANTISSA_FAST_PATH.
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.