pub struct F16(/* private fields */);Expand description
A bit-level representation of a 16-bit floating-point number.
The bits are laid out as follows:
- Sign bit: 1 bit
- Exponent width: 5 bits
- Significand precision: 11 bits (10 explicitly stored)
MSB ... LSB
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
│ ├───────┘ ├─────────────────┘
│ │ └ Significand (10 bits)
│ └ Exponent (5 bits)
└ Sign (1 bit)Trait Implementations§
Source§impl FpClassify for F16
impl FpClassify for F16
Source§impl FpFromBeBytes for F16
impl FpFromBeBytes for F16
Source§impl FpRepr for F16
impl FpRepr for F16
const ZERO: Self
const ONE: Self
const MIN: Self
const MAX: Self
const MIN_POSITIVE: Self
const INFINITY: Self
const NEG_INFINITY: Self
const BITS: u32 = 16u32
const SIGN_BITS: u32 = 1u32
const EXPONENT_BITS: u32 = 5u32
const SIGNIFICAND_BITS: u32 = 10u32
const EXPONENT_MAX: Self::Bits = {transmute(0x001f): <floats::F16 as repr::FpRepr>::Bits}
const EXPONENT_BIAS: Self::Bits = {transmute(0x000f): <floats::F16 as repr::FpRepr>::Bits}
const SIGN_MASK: Self::Bits = {transmute(0x8000): <floats::F16 as repr::FpRepr>::Bits}
const EXPONENT_MASK: Self::Bits = {transmute(0x7c00): <floats::F16 as repr::FpRepr>::Bits}
const SIGNIFICAND_MASK: Self::Bits = {transmute(0x03ff): <floats::F16 as repr::FpRepr>::Bits}
const IMPLICIT_BIT: Self::Bits = {transmute(0x0400): <floats::F16 as repr::FpRepr>::Bits}
type Bits = u16
Source§impl FpToBeBytes for F16
impl FpToBeBytes for F16
Source§impl PartialOrd for F16
impl PartialOrd for F16
impl Copy for F16
Auto Trait Implementations§
impl Freeze for F16
impl RefUnwindSafe for F16
impl Send for F16
impl Sync for F16
impl Unpin for F16
impl UnwindSafe for F16
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