FloatTraits

Trait FloatTraits 

Source
pub(crate) trait FloatTraits: Float {
    type SigType: UInt;

    const NUM_BITS: i32;
    const IMPLICIT_BIT: Self::SigType;
    const NUM_SIG_BITS: i32 = _;
    const NUM_EXP_BITS: i32 = _;
    const EXP_MASK: i32 = _;
    const EXP_BIAS: i32 = _;
    const EXP_OFFSET: i32 = _;

    // Required method
    fn to_bits(self) -> Self::SigType;

    // Provided methods
    fn is_negative(bits: Self::SigType) -> bool { ... }
    fn get_sig(bits: Self::SigType) -> Self::SigType { ... }
    fn get_exp(bits: Self::SigType) -> i64 { ... }
}

Required Associated Constants§

Provided Associated Constants§

Required Associated Types§

Required Methods§

Source

fn to_bits(self) -> Self::SigType

Provided Methods§

Source

fn is_negative(bits: Self::SigType) -> bool

Source

fn get_sig(bits: Self::SigType) -> Self::SigType

Source

fn get_exp(bits: Self::SigType) -> i64

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 FloatTraits for f32

Source§

const NUM_BITS: i32 = 32i32

Source§

const IMPLICIT_BIT: u32 = 8_388_608u32

Source§

type SigType = u32

Source§

fn to_bits(self) -> Self::SigType

Source§

impl FloatTraits for f64

Source§

const NUM_BITS: i32 = 64i32

Source§

const IMPLICIT_BIT: u64 = 4_503_599_627_370_496u64

Source§

type SigType = u64

Source§

fn to_bits(self) -> Self::SigType

Implementors§