Skip to main content

Float

Trait Float 

Source
pub trait Float: Sized {
    type Bits: Display + FromStr;

    const ARITHMETIC_NAN: Self::Bits;
    const CANONICAL_NAN: Self::Bits;

    // Required methods
    fn from_bits(bits: Self::Bits) -> Self;
    fn to_bits(&self) -> Self::Bits;
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn from_bits(bits: Self::Bits) -> Self

Source

fn to_bits(&self) -> Self::Bits

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Float for f32

Source§

const ARITHMETIC_NAN: u32 = 0x7f80_0000

Source§

const CANONICAL_NAN: u32 = 0x7fc0_0000

Source§

type Bits = u32

Source§

fn from_bits(bits: u32) -> Self

Source§

fn to_bits(&self) -> u32

Source§

impl Float for f64

Source§

const ARITHMETIC_NAN: u64 = 0x7ff0_0000_0000_0000

Source§

const CANONICAL_NAN: u64 = 0x7ff8_0000_0000_0000

Source§

type Bits = u64

Source§

fn from_bits(bits: u64) -> Self

Source§

fn to_bits(&self) -> u64

Implementors§