Trait core::num::dec2flt::float::RawFloat

source ·
pub trait RawFloat: Sized + Div<Output = Self> + Neg<Output = Self> + Mul<Output = Self> + Add<Output = Self> + LowerExp + PartialEq + PartialOrd + Default + Clone + Copy + Debug {
Show 16 associated constants and 5 methods const INFINITY: Self; const NEG_INFINITY: Self; const NAN: Self; const NEG_NAN: Self; const MANTISSA_EXPLICIT_BITS: usize; const MIN_EXPONENT_ROUND_TO_EVEN: i32; const MAX_EXPONENT_ROUND_TO_EVEN: i32; const MIN_EXPONENT_FAST_PATH: i64; const MAX_EXPONENT_FAST_PATH: i64; const MAX_EXPONENT_DISGUISED_FAST_PATH: i64; const MINIMUM_EXPONENT: i32; const INFINITE_POWER: i32; const SIGN_INDEX: usize; const SMALLEST_POWER_OF_TEN: i32; const LARGEST_POWER_OF_TEN: i32; const MAX_MANTISSA_FAST_PATH: u64 = _; // Required methods fn from_u64(v: u64) -> Self; fn from_u64_bits(v: u64) -> Self; fn pow10_fast_path(exponent: usize) -> Self; fn classify(self) -> FpCategory; fn integer_decode(self) -> (u64, i16, i8);
}
🔬This is a nightly-only experimental API. (dec2flt)
Expand description

A helper trait to avoid duplicating basically all the conversion code for f32 and f64.

See the parent module’s doc comment for why this is necessary.

Should never ever be implemented for other types or be used outside the dec2flt module.

Required Associated Constants§

source

const INFINITY: Self

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

const NEG_INFINITY: Self

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

const NAN: Self

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

const NEG_NAN: Self

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

const MANTISSA_EXPLICIT_BITS: usize

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

The number of bits in the significand, excluding the hidden bit.

source

const MIN_EXPONENT_ROUND_TO_EVEN: i32

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

const MAX_EXPONENT_ROUND_TO_EVEN: i32

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

const MIN_EXPONENT_FAST_PATH: i64

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

const MAX_EXPONENT_FAST_PATH: i64

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

const MAX_EXPONENT_DISGUISED_FAST_PATH: i64

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

const MINIMUM_EXPONENT: i32

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

const INFINITE_POWER: i32

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

const SIGN_INDEX: usize

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

const SMALLEST_POWER_OF_TEN: i32

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

const LARGEST_POWER_OF_TEN: i32

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

Provided Associated Constants§

source

const MAX_MANTISSA_FAST_PATH: u64 = _

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

Required Methods§

source

fn from_u64(v: u64) -> Self

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

Convert 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.

source

fn from_u64_bits(v: u64) -> Self

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

Performs a raw transmutation from an integer.

source

fn pow10_fast_path(exponent: usize) -> Self

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

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

source

fn classify(self) -> FpCategory

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

Returns the category that this number falls into.

source

fn integer_decode(self) -> (u64, i16, i8)

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

Returns the mantissa, exponent and sign as integers.

Implementors§