[−][src]Struct simple_soft_float::DynamicFloat
Float
with attached FPState
and dynamically settable FloatProperties
Fields
fp_state: FPState
floating-point state
value: Float<FloatProperties>
floating-point value; also accessible through *self
Methods
impl DynamicFloat
[src]
pub fn new(properties: FloatProperties) -> Self
[src]
create from properties
pub fn from_bits(bits: BigUint, properties: FloatProperties) -> Option<Self>
[src]
create from bits
and properties
pub fn into_bits(self) -> BigUint
[src]
get the bits of self
pub fn positive_zero(properties: FloatProperties) -> Self
[src]
get the positive zero value
pub fn negative_zero(properties: FloatProperties) -> Self
[src]
get the negative zero value
pub fn signed_zero(sign: Sign, properties: FloatProperties) -> Self
[src]
get the zero with sign sign
pub fn positive_infinity(properties: FloatProperties) -> Self
[src]
get the positive infinity value
pub fn negative_infinity(properties: FloatProperties) -> Self
[src]
get the negative infinity value
pub fn signed_infinity(sign: Sign, properties: FloatProperties) -> Self
[src]
get the infinity with sign sign
pub fn quiet_nan(properties: FloatProperties) -> Self
[src]
get the canonical quiet NaN, which is also just the canonical NaN
pub fn signaling_nan(properties: FloatProperties) -> Self
[src]
get the canonical signaling NaN
pub fn into_quiet_nan(self) -> Self
[src]
convert self
into a quiet NaN
pub fn to_quiet_nan(&self) -> Self
[src]
convert self
into a quiet NaN
pub fn signed_max_normal(sign: Sign, properties: FloatProperties) -> Self
[src]
get the largest finite value with sign sign
pub fn signed_min_subnormal(sign: Sign, properties: FloatProperties) -> Self
[src]
get the subnormal value closest to zero with sign sign
pub fn from_real_algebraic_number(
value: &RealAlgebraicNumber,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: &RealAlgebraicNumber,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
round from a RealAlgebraicNumber
into a floating-point value.
rounding_mode
only used for this conversion
impl DynamicFloat
[src]
pub fn add_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
add two DynamicFloat
values, returning the result
pub fn checked_add_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
add two DynamicFloat
values, returning the result
impl DynamicFloat
[src]
pub fn sub_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
subtract two DynamicFloat
values, returning the result
pub fn checked_sub_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
subtract two DynamicFloat
values, returning the result
impl DynamicFloat
[src]
pub fn mul_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
multiply two DynamicFloat
values, returning the result
pub fn checked_mul_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
multiply two DynamicFloat
values, returning the result
impl DynamicFloat
[src]
pub fn div_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
divide two DynamicFloat
values, returning the result
pub fn checked_div_with_rounding_mode(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
divide two DynamicFloat
values, returning the result
impl DynamicFloat
[src]
pub fn ieee754_remainder(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
calculate the IEEE 754 remainder of two DynamicFloat
values, returning the result
pub fn checked_ieee754_remainder(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
calculate the IEEE 754 remainder of two DynamicFloat
values, returning the result
impl DynamicFloat
[src]
pub fn fused_mul_add(
&self,
factor: &Self,
term: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
factor: &Self,
term: &Self,
rounding_mode: Option<RoundingMode>
) -> Self
calculate the result of (self * factor) + term
rounding only once, returning the result
pub fn checked_fused_mul_add(
&self,
factor: &Self,
term: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
[src]
&self,
factor: &Self,
term: &Self,
rounding_mode: Option<RoundingMode>
) -> Result<Self, FPStateMergeFailed>
calculate the result of (self * factor) + term
rounding only once, returning the result
impl DynamicFloat
[src]
pub fn round_to_integer(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<BigInt>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<BigInt>, FPState)
round self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn round_to_integral(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> Self
round self
to an integer, returning the result as a DynamicFloat
impl DynamicFloat
[src]
pub fn next_up_or_down(&self, up_or_down: UpOrDown) -> Self
[src]
compute the result of next_up
or next_down
impl DynamicFloat
[src]
pub fn next_up(&self) -> Self
[src]
compute the least floating-point number that compares greater than self
impl DynamicFloat
[src]
pub fn next_down(&self) -> Self
[src]
compute the greatest floating-point number that compares less than self
impl DynamicFloat
[src]
pub fn log_b(&self) -> (Option<BigInt>, FPState)
[src]
get the floor of the log base 2 of the absolute value of self
impl DynamicFloat
[src]
pub fn scale_b(
&self,
scale: BigInt,
rounding_mode: Option<RoundingMode>
) -> Self
[src]
&self,
scale: BigInt,
rounding_mode: Option<RoundingMode>
) -> Self
get self * 2^scale
impl DynamicFloat
[src]
pub fn sqrt(&self, rounding_mode: Option<RoundingMode>) -> Self
[src]
get the square-root of self
impl DynamicFloat
[src]
pub fn convert_from_dynamic_float(
src: &Self,
rounding_mode: Option<RoundingMode>,
properties: FloatProperties
) -> Self
[src]
src: &Self,
rounding_mode: Option<RoundingMode>,
properties: FloatProperties
) -> Self
convert src
to the floating-point format specified by properties
.
pub fn convert_from_float<SrcFT: FloatTraits>(
src: &Float<SrcFT>,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
src: &Float<SrcFT>,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert src
to the floating-point format specified by properties
.
pub fn convert_to_dynamic_float(
&self,
rounding_mode: Option<RoundingMode>,
properties: FloatProperties
) -> Self
[src]
&self,
rounding_mode: Option<RoundingMode>,
properties: FloatProperties
) -> Self
convert self
to the floating-point format specified by properties
.
pub fn abs(&self) -> Self
[src]
compute the absolute value of self
pub fn copy_sign<FT2: FloatTraits>(&self, sign_src: &Float<FT2>) -> Self
[src]
construct a DynamicFloat
from self
but with the sign of sign_src
pub fn compare(&self, rhs: &Self, quiet: bool) -> (Option<Ordering>, FPState)
[src]
compare two DynamicFloat
values
pub fn checked_compare(
&self,
rhs: &Self,
quiet: bool
) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>
[src]
&self,
rhs: &Self,
quiet: bool
) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>
compare two DynamicFloat
values
pub fn compare_quiet(&self, rhs: &Self) -> (Option<Ordering>, FPState)
[src]
compare two DynamicFloat
values
pub fn checked_compare_quiet(
&self,
rhs: &Self
) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>
[src]
&self,
rhs: &Self
) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>
compare two DynamicFloat
values
pub fn compare_signaling(&self, rhs: &Self) -> (Option<Ordering>, FPState)
[src]
compare two DynamicFloat
values
pub fn checked_compare_signaling(
&self,
rhs: &Self
) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>
[src]
&self,
rhs: &Self
) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>
compare two DynamicFloat
values
impl DynamicFloat
[src]
pub fn from_bigint(
value: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_biguint(
value: BigUint,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: BigUint,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_u8(
value: u8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: u8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_u16(
value: u16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: u16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_u32(
value: u32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: u32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_u64(
value: u64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: u64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_u128(
value: u128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: u128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_usize(
value: usize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: usize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_i8(
value: i8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: i8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_i16(
value: i16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: i16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_i32(
value: i32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: i32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_i64(
value: i64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: i64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_i128(
value: i128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: i128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn from_isize(
value: isize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
[src]
value: isize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<FPState>,
properties: FloatProperties
) -> Self
convert from integer to floating-point.
rounding_mode
only used for this conversion.
impl DynamicFloat
[src]
pub fn to_bigint(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<BigInt>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<BigInt>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_biguint(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<BigUint>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<BigUint>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_u8(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u8>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u8>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_u16(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u16>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u16>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_u32(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u32>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u32>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_u64(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u64>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u64>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_u128(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u128>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<u128>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_usize(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<usize>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<usize>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_i8(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i8>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i8>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_i16(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i16>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i16>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_i32(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i32>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i32>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_i64(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i64>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i64>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_i128(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i128>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<i128>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn to_isize(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<isize>, FPState)
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>
) -> (Option<isize>, FPState)
convert self
to an integer, returning the result as a tuple of an integer or None
, and FPState
impl DynamicFloat
[src]
pub fn rsqrt(&self, rounding_mode: Option<RoundingMode>) -> Self
[src]
compute reciprocal square-root (1.0 / sqrt(self)
)
Methods from Deref<Target = Float<FloatProperties>>
pub fn bits(&self) -> &Bits
[src]
get the underlying bits
pub fn set_bits(&mut self, bits: Bits)
[src]
set the underlying bits
pub fn traits(&self) -> &FT
[src]
get the FloatTraits
pub fn properties(&self) -> FloatProperties
[src]
get the FloatProperties
pub fn sign(&self) -> Sign
[src]
get the sign
pub fn set_sign(&mut self, sign: Sign)
[src]
set the sign
pub fn toggle_sign(&mut self)
[src]
toggle the sign
pub fn exponent_field(&self) -> Bits
[src]
get the exponent field
the mathematical exponent and the exponent field's values for normal
floating-point numbers are related by the following equation:
mathematical_exponent + exponent_bias == exponent_field
pub fn set_exponent_field(&mut self, exponent: Bits)
[src]
set the exponent field
the mathematical exponent and the exponent field's values for normal
floating-point numbers are related by the following equation:
mathematical_exponent + exponent_bias == exponent_field
pub fn mantissa_field(&self) -> Bits
[src]
get the mantissa field
pub fn set_mantissa_field(&mut self, mantissa: Bits)
[src]
set the mantissa field
pub fn mantissa_field_msb(&self) -> bool
[src]
get the mantissa field's MSB
pub fn set_mantissa_field_msb(&mut self, mantissa_msb: bool)
[src]
set the mantissa field's MSB
pub fn class(&self) -> FloatClass
[src]
calculate the FloatClass
pub fn is_negative_infinity(&self) -> bool
[src]
return true
if self.class()
is NegativeInfinity
pub fn is_negative_normal(&self) -> bool
[src]
return true
if self.class()
is NegativeNormal
pub fn is_negative_subnormal(&self) -> bool
[src]
return true
if self.class()
is NegativeSubnormal
pub fn is_negative_zero(&self) -> bool
[src]
return true
if self.class()
is NegativeZero
pub fn is_positive_infinity(&self) -> bool
[src]
return true
if self.class()
is PositiveInfinity
pub fn is_positive_normal(&self) -> bool
[src]
return true
if self.class()
is PositiveNormal
pub fn is_positive_subnormal(&self) -> bool
[src]
return true
if self.class()
is PositiveSubnormal
pub fn is_positive_zero(&self) -> bool
[src]
return true
if self.class()
is PositiveZero
pub fn is_quiet_nan(&self) -> bool
[src]
return true
if self.class()
is QuietNaN
pub fn is_signaling_nan(&self) -> bool
[src]
return true
if self.class()
is SignalingNaN
pub fn is_infinity(&self) -> bool
[src]
return true
if self
is infinity
pub fn is_normal(&self) -> bool
[src]
return true
if self.class()
is NegativeNormal
or PositiveNormal
pub fn is_subnormal(&self) -> bool
[src]
return true
if self
is subnormal
pub fn is_zero(&self) -> bool
[src]
return true
if self
is zero
pub fn is_nan(&self) -> bool
[src]
return true
if self
is NaN
pub fn is_finite(&self) -> bool
[src]
return true
if self
is finite (not NaN or infinity)
pub fn is_subnormal_or_zero(&self) -> bool
[src]
return true
if self
is subnormal or zero
pub fn to_ratio(&self) -> Option<Ratio<BigInt>>
[src]
get the mathematical value of self
as a Ratio<BigInt>
.
if self
is NaN or infinite, returns None
.
pub fn to_real_algebraic_number(&self) -> Option<RealAlgebraicNumber>
[src]
get the mathematical value of self
as a RealAlgebraicNumber
.
if self
is NaN or infinite, returns None
.
pub fn to_quiet_nan(&self) -> Self
[src]
convert self
into a quiet NaN
pub fn add(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
add floating-point numbers
pub fn sub(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
subtract floating-point numbers
pub fn mul(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
multiply floating-point numbers
pub fn div(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
divide floating-point numbers
pub fn ieee754_remainder(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
compute the IEEE 754 remainder of two floating-point numbers
pub fn fused_mul_add(
&self,
factor: &Self,
term: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
factor: &Self,
term: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
calculate the result of (self * factor) + term
rounding only once, returning the result
pub fn round_to_integer(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<BigInt>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<BigInt>
round self
to an integer, returning the result as an integer or None
pub fn round_to_integral(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
round self
to an integer, returning the result as a Float
pub fn normalize(&mut self)
[src]
normalize self
.
This is a no-op for all floating-point formats where
has_implicit_leading_bit
is true
(which includes all standard
floating-point formats).
pub fn next_up_or_down(
&self,
up_or_down: UpOrDown,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
up_or_down: UpOrDown,
fp_state: Option<&mut FPState>
) -> Self
compute the result of next_up
or next_down
pub fn next_up(&self, fp_state: Option<&mut FPState>) -> Self
[src]
compute the least floating-point number that compares greater than self
pub fn next_down(&self, fp_state: Option<&mut FPState>) -> Self
[src]
compute the greatest floating-point number that compares less than self
pub fn log_b(&self, fp_state: Option<&mut FPState>) -> Option<BigInt>
[src]
get the floor of the log base 2 of the absolute value of self
pub fn scale_b(
&self,
scale: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
scale: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
get self * 2^scale
pub fn sqrt(
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
get the square-root of self
pub fn convert_to_float_with_traits<DestFT: FloatTraits>(
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: DestFT
) -> Float<DestFT>
[src]
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: DestFT
) -> Float<DestFT>
convert self
to the floating-point format specified by traits
.
pub fn convert_to_float<DestFT: FloatTraits + Default>(
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Float<DestFT>
[src]
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Float<DestFT>
convert self
to the floating-point format specified by DestFT::default()
.
pub fn neg_assign(&mut self)
[src]
negate and assign the result back to self
.
identical to self.toggle_sign()
pub fn neg(&self) -> Self
[src]
compute the negation of self
pub fn abs_assign(&mut self)
[src]
compute the absolute-value and assign the result back to self
.
identical to self.set_sign(Sign::Positive)
pub fn abs(&self) -> Self
[src]
compute the absolute-value
pub fn copy_sign_assign<FT2: FloatTraits>(&mut self, sign_src: &Float<FT2>)
[src]
set self
's sign to the sign of sign_src
pub fn copy_sign<FT2: FloatTraits>(&self, sign_src: &Float<FT2>) -> Self
[src]
construct a Float
from self
but with the sign of sign_src
pub fn compare(
&self,
rhs: &Self,
quiet: bool,
fp_state: Option<&mut FPState>
) -> Option<Ordering>
[src]
&self,
rhs: &Self,
quiet: bool,
fp_state: Option<&mut FPState>
) -> Option<Ordering>
compare two Float
values
pub fn compare_quiet(
&self,
rhs: &Self,
fp_state: Option<&mut FPState>
) -> Option<Ordering>
[src]
&self,
rhs: &Self,
fp_state: Option<&mut FPState>
) -> Option<Ordering>
compare two Float
values
pub fn compare_signaling(
&self,
rhs: &Self,
fp_state: Option<&mut FPState>
) -> Option<Ordering>
[src]
&self,
rhs: &Self,
fp_state: Option<&mut FPState>
) -> Option<Ordering>
compare two Float
values
pub fn to_bigint(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<BigInt>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<BigInt>
convert from floating-point to integer
pub fn to_biguint(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<BigUint>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<BigUint>
convert from floating-point to integer
pub fn to_u8(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u8>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u8>
convert from floating-point to integer
pub fn to_u16(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u16>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u16>
convert from floating-point to integer
pub fn to_u32(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u32>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u32>
convert from floating-point to integer
pub fn to_u64(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u64>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u64>
convert from floating-point to integer
pub fn to_u128(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u128>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<u128>
convert from floating-point to integer
pub fn to_usize(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<usize>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<usize>
convert from floating-point to integer
pub fn to_i8(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i8>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i8>
convert from floating-point to integer
pub fn to_i16(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i16>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i16>
convert from floating-point to integer
pub fn to_i32(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i32>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i32>
convert from floating-point to integer
pub fn to_i64(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i64>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i64>
convert from floating-point to integer
pub fn to_i128(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i128>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<i128>
convert from floating-point to integer
pub fn to_isize(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<isize>
[src]
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Option<isize>
convert from floating-point to integer
pub fn rsqrt(
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
[src]
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>
) -> Self
reciprocal square root -- computes 1 / sqrt(self)
Trait Implementations
impl<'_> Add<&'_ DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the +
operator.
fn add(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl<'a, 'b> Add<&'a DynamicFloat> for &'b DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the +
operator.
fn add(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl Add<DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the +
operator.
fn add(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> Add<DynamicFloat> for &'_ DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the +
operator.
fn add(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> AddAssign<&'_ DynamicFloat> for DynamicFloat
[src]
fn add_assign(&mut self, rhs: &DynamicFloat)
[src]
impl AddAssign<DynamicFloat> for DynamicFloat
[src]
fn add_assign(&mut self, rhs: DynamicFloat)
[src]
impl Clone for DynamicFloat
[src]
fn clone(&self) -> DynamicFloat
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DynamicFloat
[src]
impl Deref for DynamicFloat
[src]
type Target = Float<FloatProperties>
The resulting type after dereferencing.
fn deref(&self) -> &Float<FloatProperties>
[src]
returns &self.value
impl DerefMut for DynamicFloat
[src]
fn deref_mut(&mut self) -> &mut Float<FloatProperties>
[src]
returns &mut self.value
impl<'_> Div<&'_ DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the /
operator.
fn div(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl<'a, 'b> Div<&'a DynamicFloat> for &'b DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the /
operator.
fn div(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl Div<DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the /
operator.
fn div(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> Div<DynamicFloat> for &'_ DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the /
operator.
fn div(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> DivAssign<&'_ DynamicFloat> for DynamicFloat
[src]
fn div_assign(&mut self, rhs: &DynamicFloat)
[src]
impl DivAssign<DynamicFloat> for DynamicFloat
[src]
fn div_assign(&mut self, rhs: DynamicFloat)
[src]
impl From<DynamicFloat> for Float<FloatProperties>
[src]
fn from(value: DynamicFloat) -> Self
[src]
impl From<Float<FloatProperties>> for DynamicFloat
[src]
fn from(value: Float<FloatProperties>) -> Self
[src]
impl<'_> Mul<&'_ DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the *
operator.
fn mul(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl<'a, 'b> Mul<&'a DynamicFloat> for &'b DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the *
operator.
fn mul(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl Mul<DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the *
operator.
fn mul(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> Mul<DynamicFloat> for &'_ DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the *
operator.
fn mul(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> MulAssign<&'_ DynamicFloat> for DynamicFloat
[src]
fn mul_assign(&mut self, rhs: &DynamicFloat)
[src]
impl MulAssign<DynamicFloat> for DynamicFloat
[src]
fn mul_assign(&mut self, rhs: DynamicFloat)
[src]
impl<'_> Neg for &'_ DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the -
operator.
fn neg(self) -> DynamicFloat
[src]
impl Neg for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the -
operator.
fn neg(self) -> DynamicFloat
[src]
impl<'_> Sub<&'_ DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the -
operator.
fn sub(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl<'a, 'b> Sub<&'a DynamicFloat> for &'b DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the -
operator.
fn sub(self, rhs: &DynamicFloat) -> DynamicFloat
[src]
impl Sub<DynamicFloat> for DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the -
operator.
fn sub(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> Sub<DynamicFloat> for &'_ DynamicFloat
[src]
type Output = DynamicFloat
The resulting type after applying the -
operator.
fn sub(self, rhs: DynamicFloat) -> DynamicFloat
[src]
impl<'_> SubAssign<&'_ DynamicFloat> for DynamicFloat
[src]
fn sub_assign(&mut self, rhs: &DynamicFloat)
[src]
impl SubAssign<DynamicFloat> for DynamicFloat
[src]
fn sub_assign(&mut self, rhs: DynamicFloat)
[src]
Auto Trait Implementations
impl RefUnwindSafe for DynamicFloat
impl Send for DynamicFloat
impl Sync for DynamicFloat
impl Unpin for DynamicFloat
impl UnwindSafe for DynamicFloat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,