numcodecs_bit_round

Trait Float

Source
pub trait Float: Sized + Copy {
    type Binary: Copy + Not<Output = Self::Binary> + Shr<u32, Output = Self::Binary> + Add<Self::Binary, Output = Self::Binary> + AddAssign<Self::Binary> + BitAnd<Self::Binary, Output = Self::Binary> + BitAndAssign<Self::Binary>;

    const MANITSSA_BITS: u32;
    const MANTISSA_MASK: Self::Binary;
    const BINARY_ONE: Self::Binary;
    const TY: AnyArrayDType;

    // Required methods
    fn to_binary(self) -> Self::Binary;
    fn from_binary(u: Self::Binary) -> Self;
}
Expand description

Floating point types.

Required Associated Constants§

Source

const MANITSSA_BITS: u32

Number of significant digits in base 2

Source

const MANTISSA_MASK: Self::Binary

Binary mask to extract only the mantissa bits

Source

const BINARY_ONE: Self::Binary

Binary 0x1

Source

const TY: AnyArrayDType

Dtype of this type

Required Associated Types§

Source

type Binary: Copy + Not<Output = Self::Binary> + Shr<u32, Output = Self::Binary> + Add<Self::Binary, Output = Self::Binary> + AddAssign<Self::Binary> + BitAnd<Self::Binary, Output = Self::Binary> + BitAndAssign<Self::Binary>

Binary representation of this type

Required Methods§

Source

fn to_binary(self) -> Self::Binary

Bit-cast the floating point value to its binary representation

Source

fn from_binary(u: Self::Binary) -> Self

Bit-cast the binary representation into a floating point value

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 BINARY_ONE: Self::Binary = {transmute(0x00000001): <f32 as Float>::Binary}

Source§

const MANITSSA_BITS: u32 = 23u32

Source§

const MANTISSA_MASK: Self::Binary = {transmute(0x007fffff): <f32 as Float>::Binary}

Source§

const TY: AnyArrayDType = AnyArrayDType::F32

Source§

type Binary = u32

Source§

fn to_binary(self) -> Self::Binary

Source§

fn from_binary(u: Self::Binary) -> Self

Source§

impl Float for f64

Source§

const BINARY_ONE: Self::Binary = {transmute(0x0000000000000001): <f64 as Float>::Binary}

Source§

const MANITSSA_BITS: u32 = 52u32

Source§

const MANTISSA_MASK: Self::Binary = {transmute(0x000fffffffffffff): <f64 as Float>::Binary}

Source§

const TY: AnyArrayDType = AnyArrayDType::F64

Source§

type Binary = u64

Source§

fn to_binary(self) -> Self::Binary

Source§

fn from_binary(u: Self::Binary) -> Self

Implementors§