Skip to main content

FloatPrimitive

Trait FloatPrimitive 

Source
pub unsafe trait FloatPrimitive: Sized + Copy {
    type UInt: BitOr<Output = Self::UInt> + BitAnd<Output = Self::UInt> + Not<Output = Self::UInt>;

    const SIGN_MASK: Self::UInt;

    // Required methods
    fn to_bits(self) -> Self::UInt;
    fn from_bits(bits: Self::UInt) -> Self;
}
🔬This is a nightly-only experimental API. (core_intrinsics)
Expand description

Built-in float types (f16, f32, f64 and f128).

§Safety

Must actually be such a type.

Required Associated Constants§

Source

const SIGN_MASK: Self::UInt

🔬This is a nightly-only experimental API. (core_intrinsics)

Required Associated Types§

Source

type UInt: BitOr<Output = Self::UInt> + BitAnd<Output = Self::UInt> + Not<Output = Self::UInt>

🔬This is a nightly-only experimental API. (core_intrinsics)

Required Methods§

Source

fn to_bits(self) -> Self::UInt

🔬This is a nightly-only experimental API. (core_intrinsics)
Source

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

🔬This is a nightly-only experimental API. (core_intrinsics)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl FloatPrimitive for f16

Source§

const SIGN_MASK: Self::UInt = f16::SIGN_MASK

Source§

type UInt = u16

Source§

impl FloatPrimitive for f32

Source§

const SIGN_MASK: Self::UInt = f32::SIGN_MASK

Source§

type UInt = u32

Source§

impl FloatPrimitive for f64

Source§

const SIGN_MASK: Self::UInt = f64::SIGN_MASK

Source§

type UInt = u64

Source§

impl FloatPrimitive for f128

Source§

const SIGN_MASK: Self::UInt = f128::SIGN_MASK

Source§

type UInt = u128