Struct Norm

Source
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>

Source

const EXP_UNBIAS: u32

Unbias the exponent and account for the mantissa’s precision, including the guard bit.

Source

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.

Source

fn from_float(x: F) -> Self

Source

fn is_zero_nan_inf(self) -> bool

True if the value was zero, infinity, or NaN.

Source

fn is_zero(self) -> bool

The only value we have

Trait Implementations§

Source§

impl<F: Clone + Float> Clone for Norm<F>
where F::Int: Clone,

Source§

fn clone(&self) -> Norm<F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Debug + Float> Debug for Norm<F>
where F::Int: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: Copy + Float> Copy for Norm<F>
where F::Int: Copy,

Auto Trait Implementations§

§

impl<F> Freeze for Norm<F>
where <F as Float>::Int: Freeze,

§

impl<F> RefUnwindSafe for Norm<F>
where <F as Float>::Int: RefUnwindSafe,

§

impl<F> Send for Norm<F>
where <F as Float>::Int: Send,

§

impl<F> Sync for Norm<F>
where <F as Float>::Int: Sync,

§

impl<F> Unpin for Norm<F>
where <F as Float>::Int: Unpin,

§

impl<F> UnwindSafe for Norm<F>
where <F as Float>::Int: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.