pub struct F32(/* private fields */);Expand description
A bit-level representation of a 32-bit floating-point number.
The bits are laid out as follows:
- Sign bit: 1 bit
- Exponent width: 8 bits
- Significand precision: 24 bits (23 explicitly stored)
MSB ... LSB
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
│ ├─────────────┘ ├───────────────────────────────────────────┘
│ │ └ Significand (23 bits)
│ └ Exponent (8 bits)
└ Sign (1 bit)Trait Implementations§
Source§impl FpClassify for F32
impl FpClassify for F32
Source§impl FpFromBeBytes for F32
impl FpFromBeBytes for F32
Source§impl FpPack for F32
impl FpPack for F32
type Validator = PackedFloatValidator<f32>
fn pack_native(self, validator: &Self::Validator) -> PackedFloat
fn pack_optimal(self, validator: &Self::Validator) -> PackedFloat
Source§impl FpRepr for F32
impl FpRepr for F32
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 = 32u32
const SIGN_BITS: u32 = 1u32
const EXPONENT_BITS: u32 = 8u32
const SIGNIFICAND_BITS: u32 = 23u32
const EXPONENT_MAX: Self::Bits = {transmute(0x000000ff): <floats::F32 as repr::FpRepr>::Bits}
const EXPONENT_BIAS: Self::Bits = {transmute(0x0000007f): <floats::F32 as repr::FpRepr>::Bits}
const SIGN_MASK: Self::Bits = {transmute(0x80000000): <floats::F32 as repr::FpRepr>::Bits}
const EXPONENT_MASK: Self::Bits = {transmute(0x7f800000): <floats::F32 as repr::FpRepr>::Bits}
const SIGNIFICAND_MASK: Self::Bits = {transmute(0x007fffff): <floats::F32 as repr::FpRepr>::Bits}
const IMPLICIT_BIT: Self::Bits = {transmute(0x00800000): <floats::F32 as repr::FpRepr>::Bits}
type Bits = u32
Source§impl FpToBeBytes for F32
impl FpToBeBytes for F32
Source§impl PartialOrd for F32
impl PartialOrd for F32
impl Copy for F32
Auto Trait Implementations§
impl Freeze for F32
impl RefUnwindSafe for F32
impl Send for F32
impl Sync for F32
impl Unpin for F32
impl UnwindSafe for F32
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