Expand description
Controls the semantics of a floating point number using two fields: ‘precision’, that determines the number of bits, and ‘exponent’ that controls the dynamic range of the number.
Fields§
§exponent: usizeThe number of bits that define the range of the exponent.
precision: usizeThe number of bits in the significand (mantissa + 1).
Implementations§
source§impl Semantics
impl Semantics
sourcepub fn get_precision(&self) -> usize
pub fn get_precision(&self) -> usize
Returns the precision in bits.
sourcepub fn get_mantissa_len(&self) -> usize
pub fn get_mantissa_len(&self) -> usize
Returns the length of the mantissa in bits (precision - 1).
sourcepub fn get_exponent_len(&self) -> usize
pub fn get_exponent_len(&self) -> usize
Returns the length of the exponent in bits, which defines the valid range.
sourcepub fn increase_precision(&self, more: usize) -> Semantics
pub fn increase_precision(&self, more: usize) -> Semantics
Create a new float semantics with increased precision with ‘add’ additional digits.
sourcepub fn grow_log(&self, more: usize) -> Semantics
pub fn grow_log(&self, more: usize) -> Semantics
Create a new float semantics with increased precision with ‘add’ additional digits, plus ceil(log2) of the number.
sourcepub fn increase_exponent(&self, more: usize) -> Semantics
pub fn increase_exponent(&self, more: usize) -> Semantics
Create a new float semantics with increased exponent with ‘more’ additional digits.