Struct Fp

pub struct Fp { pub f: u64, pub e: i16 }

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

Fields

f: u64

The integer mantissa.

e: i16

The exponent in base 2.

Implementations

impl Fp

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

Returns a correctly rounded product of itself and other.

fn normalize(self) -> Self

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

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

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

Trait Implementations

impl Clone for Fp

fn clone(&self) -> Fp

impl Copy for Fp

impl Debug for Fp

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

impl TrivialClone for Fp