Trait Lemire

pub trait Lemire: FloatExt

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.

Associated Constants

const MAX_EXPONENT_FAST_PATH: i64 = _;

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

const MIN_EXPONENT_FAST_PATH: i64 = _;

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

const MAX_EXPONENT_DISGUISED_FAST_PATH: i64 = _;

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

const MAX_MANTISSA_FAST_PATH: u64 = _;

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

Required Methods

fn pow10_fast_path(exponent: usize) -> Self

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

fn from_u64(v: u64) -> Self

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.

Implementors