pub trait Float: Number + Neg<Output = Self> {
    type Unsigned: UnsignedInteger;
Show 21 associated constants and 21 methods const ZERO: Self; const ONE: Self; const TWO: Self; const MAX: Self; const MIN: Self; const INFINITY: Self; const NEG_INFINITY: Self; const NAN: Self; const BITS: usize; const SIGN_MASK: Self::Unsigned; const EXPONENT_MASK: Self::Unsigned; const HIDDEN_BIT_MASK: Self::Unsigned; const MANTISSA_MASK: Self::Unsigned; const CARRY_MASK: Self::Unsigned; const INFINITY_BITS: Self::Unsigned; const NEGATIVE_INFINITY_BITS: Self::Unsigned; const EXPONENT_SIZE: i32; const MANTISSA_SIZE: i32; const EXPONENT_BIAS: i32; const DENORMAL_EXPONENT: i32; const MAX_EXPONENT: i32; fn to_bits(self) -> Self::Unsigned; fn from_bits(u: Self::Unsigned) -> Self; fn ln(self) -> Self; fn floor(self) -> Self; fn is_sign_positive(self) -> bool; fn is_sign_negative(self) -> bool; fn is_denormal(self) -> bool { ... } fn is_special(self) -> bool { ... } fn is_nan(self) -> bool { ... } fn is_inf(self) -> bool { ... } fn is_odd(self) -> bool { ... } fn is_even(self) -> bool { ... } fn exponent(self) -> i32 { ... } fn mantissa(self) -> Self::Unsigned { ... } fn next(self) -> Self { ... } fn next_positive(self) -> Self { ... } fn prev(self) -> Self { ... } fn prev_positive(self) -> Self { ... } fn round_positive_even(self) -> Self { ... } fn max_finite(self, f: Self) -> Self { ... } fn min_finite(self, f: Self) -> Self { ... }
}
Expand description

Float information for native float types.

Required Associated Types

Unsigned type of the same size.

Required Associated Constants

Bitmask for the sign bit.

Bitmask for the exponent, including the hidden bit.

Bitmask for the hidden bit in exponent, which is an implicit 1 in the fraction.

Bitmask for the mantissa (fraction), excluding the hidden bit.

Mask to determine if a full-carry occurred (1 in bit above hidden bit).

Positive infinity as bits.

Positive infinity as bits.

Size of the exponent.

Size of the significand (mantissa) without hidden bit.

Bias of the exponent.

Exponent portion of a denormal float.

Maximum exponent value in float.

Required Methods

Provided Methods

Returns true if the float is a denormal.

Returns true if the float is a NaN or Infinite.

Returns true if the float is NaN.

Returns true if the float is infinite.

Returns true if the float’s least-significant mantissa bit is odd.

Returns true if the float’s least-significant mantissa bit is even.

Get exponent component from the float.

Get mantissa (significand) component from float.

Get next greater float.

Get next greater float for a positive float. Value must be >= 0.0 and < INFINITY.

Get previous greater float, such that self.prev().next() == self.

Get previous greater float for a positive float. Value must be > 0.0.

Round a positive number to even.

Get the max of two finite numbers.

Get the min of two finite numbers.

Implementations on Foreign Types

Implementors