pub struct Uf8E5M3(/* private fields */);Expand description
An 8-bit unsigned float with 5 exponent bits and 3 mantissa bits.
Implementations§
Source§impl Uf8E5M3
impl Uf8E5M3
pub const EXPONENT_BITS: u32 = 5
pub const MANTISSA_BITS: u32 = 3
pub const EXPONENT_BIAS: i32 = 15
pub const EXPONENT_MASK: u8 = 0xf8
pub const MANTISSA_MASK: u8 = 0x07
pub const ZERO: Self
pub const ONE: Self
pub const INFINITY: Self
pub const NAN: Self
pub const MAX: Self
pub const MIN_POSITIVE: Self
pub const MIN_NORMAL: Self
pub const fn from_bits(bits: u8) -> Self
pub const fn to_bits(self) -> u8
pub fn from_f32(value: f32) -> Self
pub fn to_f32(self) -> f32
pub fn from_f64(value: f64) -> Self
pub fn to_f64(self) -> f64
pub fn try_from_f64(value: f64) -> Result<Self, ConversionError>
pub fn from_f16(value: f16) -> Self
pub fn to_f16(self) -> f16
pub const fn exponent(self) -> u8
pub const fn mantissa(self) -> u8
pub const fn is_zero(self) -> bool
pub const fn is_nan(self) -> bool
pub const fn is_infinite(self) -> bool
pub const fn is_finite(self) -> bool
pub const fn is_subnormal(self) -> bool
Trait Implementations§
Source§impl Ord for Uf8E5M3
impl Ord for Uf8E5M3
Source§impl PartialOrd for Uf8E5M3
impl PartialOrd for Uf8E5M3
impl Copy for Uf8E5M3
impl Eq for Uf8E5M3
impl StructuralPartialEq for Uf8E5M3
Auto Trait Implementations§
impl Freeze for Uf8E5M3
impl RefUnwindSafe for Uf8E5M3
impl Send for Uf8E5M3
impl Sync for Uf8E5M3
impl Unpin for Uf8E5M3
impl UnsafeUnpin for Uf8E5M3
impl UnwindSafe for Uf8E5M3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more