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) -> Self

Performs 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 that s * m * 2^p represents 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 be EXP_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

s is only ever +/-1.

Implementors