Trait rustc_apfloat::ieee::Semantics [−][src]
pub trait Semantics: Sized { const BITS: usize; const PRECISION: usize; const MAX_EXP: ExpInt; const MIN_EXP: ExpInt; const QNAN_BIT: usize; const QNAN_SIGNIFICAND: u128; fn from_bits(bits: u128) -> IeeeFloat<Self> { ... } fn to_bits(x: IeeeFloat<Self>) -> u128 { ... } }
Expand description
Represents floating point arithmetic semantics.
Associated Constants
The largest E such that 2E is representable; this matches the definition of IEEE 754.
The smallest E such that 2E is a normalized number; this matches the definition of IEEE 754.
const QNAN_SIGNIFICAND: u128
[src]
const QNAN_SIGNIFICAND: u128
[src]The significand bitpattern to mark a NaN as quiet. NOTE: for X87DoubleExtended we need to set two bits instead of 2.
Provided methods
Implementors
For x87 extended precision, we want to make a NaN, not a pseudo-NaN. Maybe we should expose the ability to make pseudo-NaNs?
Integer bit is explicit in this format. Intel hardware (387 and later) does not support these bit patterns: exponent = all 1’s, integer bit 0, significand 0 (“pseudoinfinity”) exponent = all 1’s, integer bit 0, significand nonzero (“pseudoNaN”) exponent = 0, integer bit 1 (“pseudodenormal”) exponent != 0 nor all 1’s, integer bit 0 (“unnormal”) At the moment, the first two are treated as NaNs, the second two as Normal.