Trait FloatExt
pub trait FloatExt: Float
Items that ideally would be on Float, but don't apply to all float types because they
rely on the mantissa fitting into a u64 (which isn't true for f128).
Required Methods
fn from_u64_bits(v: u64) -> SelfPerforms a raw transmutation from an integer.
Provided Methods
fn integer_decode(self) -> (u64, i16, i8)Returns the mantissa, exponent and sign as integers.
This returns
(m, p, s)such thats * m * 2^prepresents the original float. For 0, the exponent will be-(EXP_BIAS + SIG_BITS), which is the minimum subnormal power. For infinity or NaN, the exponent will beEXP_SAT - EXP_BIAS - SIG_BITS.If subnormal, the mantissa will be shifted one bit to the left. Otherwise, it is returned with the explicit bit set but otherwise unshifted
sis only ever +/-1.