Struct core::num::diy_float::Fp

source ·
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: &Fp) -> Fp

🔬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) -> Fp

🔬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) -> Fp

🔬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).