Struct Fp

Source
#[doc(hidden)] pub struct Fp {
    pub f: u64,
    pub e: i16,
}
🔬This is a nightly-only experimental API. (core_private_diy_float)
Expand description

A custom 64-bit floating point type, representing f * 2^e.

Fields§

§f: u64
🔬This is a nightly-only experimental API. (core_private_diy_float)

The integer mantissa.

§e: i16
🔬This is a nightly-only experimental API. (core_private_diy_float)

The exponent in base 2.

Implementations§

Source§

impl Fp

Source

pub fn mul(self, other: Self) -> Self

🔬This is a nightly-only experimental API. (core_private_diy_float)

Returns a correctly rounded product of itself and other.

Source

pub fn normalize(self) -> Self

🔬This is a nightly-only experimental API. (core_private_diy_float)

Normalizes itself so that the resulting mantissa is at least 2^63.

Source

pub fn normalize_to(self, e: i16) -> Self

🔬This is a nightly-only experimental API. (core_private_diy_float)

Normalizes itself to have the shared exponent. It can only decrease the exponent (and thus increase the mantissa).

Trait Implementations§

Source§

impl Clone for Fp

Source§

fn clone(&self) -> Fp

Returns a copy 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 Debug for Fp

Source§

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

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

impl Copy for Fp