[−][src]Trait rustc_apfloat::ieee::Semantics

pub trait Semantics: Sized {
    pub const BITS: usize;
    pub const PRECISION: usize;
    pub const MAX_EXP: ExpInt;
    pub const MIN_EXP: ExpInt;
    pub const QNAN_BIT: usize;
    pub const QNAN_SIGNIFICAND: u128;
    pub fn from_bits(bits: u128) -> IeeeFloat<Self> { ... }
pub fn to_bits(x: IeeeFloat<Self>) -> u128 { ... } }

Represents floating point arithmetic semantics.

Associated Constants

pub const BITS: usize[src]

Total number of bits in the in-memory format.

pub const PRECISION: usize[src]

Number of bits in the significand. This includes the integer bit.

pub const MAX_EXP: ExpInt[src]

The largest E such that 2E is representable; this matches the definition of IEEE 754.

pub const MIN_EXP: ExpInt[src]

The smallest E such that 2E is a normalized number; this matches the definition of IEEE 754.

pub const QNAN_BIT: usize[src]

The significand bit that marks NaN as quiet.

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

Loading content...

Provided methods

pub fn from_bits(bits: u128) -> IeeeFloat<Self>[src]

pub fn to_bits(x: IeeeFloat<Self>) -> u128[src]

Loading content...

Implementors

impl Semantics for DoubleS[src]

impl Semantics for HalfS[src]

impl Semantics for QuadS[src]

impl Semantics for SingleS[src]

impl Semantics for X87DoubleExtendedS[src]

pub const QNAN_SIGNIFICAND: u128[src]

For x87 extended precision, we want to make a NaN, not a pseudo-NaN. Maybe we should expose the ability to make pseudo-NaNs?

pub fn from_bits(bits: u128) -> IeeeFloat<Self>[src]

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.

impl<F: Float> Semantics for FallbackExtendedS<F>[src]

impl<F: Float> Semantics for FallbackS<F>[src]

Loading content...