struct Norm<F: Float> {
m: F::Int,
e: i32,
neg: bool,
}
Expand description
Representation of F
that has handled subnormals.
Fields§
§m: F::Int
Normalized significand with one guard bit, unsigned.
e: i32
Exponent of the mantissa such that m * 2^e = x
. Accounts for the shift in the mantissa
and the guard bit; that is, 1.0 will normalize as m = 1 << 53
and e = -53
.
neg: bool
Implementations§
Source§impl<F: Float> Norm<F>
impl<F: Float> Norm<F>
Sourceconst EXP_UNBIAS: u32
const EXP_UNBIAS: u32
Unbias the exponent and account for the mantissa’s precision, including the guard bit.
Sourceconst ZERO_INF_NAN: u32
const ZERO_INF_NAN: u32
Values greater than this had a saturated exponent (infinity or NaN), OR were zero and we adjusted the exponent such that it exceeds this threashold.
fn from_float(x: F) -> Self
Sourcefn is_zero_nan_inf(self) -> bool
fn is_zero_nan_inf(self) -> bool
True if the value was zero, infinity, or NaN.
Trait Implementations§
impl<F: Copy + Float> Copy for Norm<F>
Auto Trait Implementations§
impl<F> Freeze for Norm<F>
impl<F> RefUnwindSafe for Norm<F>
impl<F> Send for Norm<F>
impl<F> Sync for Norm<F>
impl<F> Unpin for Norm<F>
impl<F> UnwindSafe for Norm<F>
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