Trait numcodecs_bit_round::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

Object Safety§

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§