Trait vortex_alp::ALPRDFloat
source · pub trait ALPRDFloat:
Sealed
+ Float
+ Copy
+ NativePType {
type UINT: NativePType + PrimInt + One + Copy;
const BITS: usize = _;
// Required methods
fn from_bits(bits: Self::UINT) -> Self;
fn to_bits(value: Self) -> Self::UINT;
fn to_u16(bits: Self::UINT) -> u16;
fn from_u16(value: u16) -> Self::UINT;
}
Expand description
Main trait for ALP-RD encodable floating point numbers.
Like the paper, we limit this to the IEEE7 754 single-precision (f32
) and double-precision
(f64
) floating point types.
Required Associated Types§
Provided Associated Constants§
Required Methods§
sourcefn from_bits(bits: Self::UINT) -> Self
fn from_bits(bits: Self::UINT) -> Self
Bit-wise transmute from the unsigned integer type to the floating-point type.
Object Safety§
This trait is not object safe.