Skip to main content

Lemire

Trait Lemire 

Source
#[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; }
🔬This is a nightly-only experimental API. (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§

Source

const MAX_EXPONENT_FAST_PATH: i64 = _

🔬This is a nightly-only experimental API. (dec2flt)

Maximum exponent for a fast path case, or ⌊(SIG_BITS+1)/log2(5)⌋

Source

const MIN_EXPONENT_FAST_PATH: i64 = _

🔬This is a nightly-only experimental API. (dec2flt)

Minimum exponent for a fast path case, or -⌊(SIG_BITS+1)/log2(5)⌋

Source

const MAX_EXPONENT_DISGUISED_FAST_PATH: i64 = _

🔬This is a nightly-only experimental API. (dec2flt)

Maximum exponent that can be represented for a disguised-fast path case. This is MAX_EXPONENT_FAST_PATH + ⌊(SIG_BITS+1)/log2(10)⌋

Source

const MAX_MANTISSA_FAST_PATH: u64 = _

🔬This is a nightly-only experimental API. (dec2flt)

Maximum mantissa for the fast-path (1 << 53 for f64).

Required Methods§

Source

fn pow10_fast_path(exponent: usize) -> Self

🔬This is a nightly-only experimental API. (dec2flt)

Gets a small power-of-ten for fast-path multiplication.

Source

fn from_u64(v: u64) -> Self

🔬This is a nightly-only experimental API. (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.

Implementors§

Source§

impl Lemire for f16

Available on target_has_reliable_f16 only.
Source§

impl Lemire for f32

Source§

impl Lemire for f64