Struct DynamicFloat

Source
pub struct DynamicFloat {
    pub fp_state: FPState,
    pub value: Float<FloatProperties>,
    /* private fields */
}
Expand description

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

Implementations§

Source§

impl DynamicFloat

Source

pub fn new(properties: FloatProperties) -> Self

create from properties

Source

pub fn from_bits(bits: BigUint, properties: FloatProperties) -> Option<Self>

create from bits and properties

Source

pub fn into_bits(self) -> BigUint

get the bits of self

Source

pub fn positive_zero(properties: FloatProperties) -> Self

get the positive zero value

Source

pub fn negative_zero(properties: FloatProperties) -> Self

get the negative zero value

Source

pub fn signed_zero(sign: Sign, properties: FloatProperties) -> Self

get the zero with sign sign

Source

pub fn positive_infinity(properties: FloatProperties) -> Self

get the positive infinity value

Source

pub fn negative_infinity(properties: FloatProperties) -> Self

get the negative infinity value

Source

pub fn signed_infinity(sign: Sign, properties: FloatProperties) -> Self

get the infinity with sign sign

Source

pub fn quiet_nan(properties: FloatProperties) -> Self

get the canonical quiet NaN, which is also just the canonical NaN

Source

pub fn signaling_nan(properties: FloatProperties) -> Self

get the canonical signaling NaN

Source

pub fn into_quiet_nan(self) -> Self

convert self into a quiet NaN

Source

pub fn to_quiet_nan(&self) -> Self

convert self into a quiet NaN

Source

pub fn signed_max_normal(sign: Sign, properties: FloatProperties) -> Self

get the largest finite value with sign sign

Source

pub fn signed_min_subnormal(sign: Sign, properties: FloatProperties) -> Self

get the subnormal value closest to zero with sign sign

Source

pub fn from_real_algebraic_number( 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

Source§

impl DynamicFloat

Source

pub fn add_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Self

add two DynamicFloat values, returning the result

Source

pub fn checked_add_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Result<Self, FPStateMergeFailed>

add two DynamicFloat values, returning the result

Source§

impl DynamicFloat

Source

pub fn sub_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Self

subtract two DynamicFloat values, returning the result

Source

pub fn checked_sub_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Result<Self, FPStateMergeFailed>

subtract two DynamicFloat values, returning the result

Source§

impl DynamicFloat

Source

pub fn mul_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Self

multiply two DynamicFloat values, returning the result

Source

pub fn checked_mul_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Result<Self, FPStateMergeFailed>

multiply two DynamicFloat values, returning the result

Source§

impl DynamicFloat

Source

pub fn div_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Self

divide two DynamicFloat values, returning the result

Source

pub fn checked_div_with_rounding_mode( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Result<Self, FPStateMergeFailed>

divide two DynamicFloat values, returning the result

Source§

impl DynamicFloat

Source

pub fn ieee754_remainder( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Self

calculate the IEEE 754 remainder of two DynamicFloat values, returning the result

Source

pub fn checked_ieee754_remainder( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, ) -> Result<Self, FPStateMergeFailed>

calculate the IEEE 754 remainder of two DynamicFloat values, returning the result

Source§

impl DynamicFloat

Source

pub fn fused_mul_add( &self, factor: &Self, term: &Self, rounding_mode: Option<RoundingMode>, ) -> Self

calculate the result of (self * factor) + term rounding only once, returning the result

Source

pub fn checked_fused_mul_add( &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

Source§

impl DynamicFloat

Source

pub fn round_to_integer( &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

Source§

impl DynamicFloat

Source

pub fn round_to_integral( &self, exact: bool, rounding_mode: Option<RoundingMode>, ) -> Self

round self to an integer, returning the result as a DynamicFloat

Source§

impl DynamicFloat

Source

pub fn next_up_or_down(&self, up_or_down: UpOrDown) -> Self

compute the result of next_up or next_down

Source§

impl DynamicFloat

Source

pub fn next_up(&self) -> Self

compute the least floating-point number that compares greater than self

Source§

impl DynamicFloat

Source

pub fn next_down(&self) -> Self

compute the greatest floating-point number that compares less than self

Source§

impl DynamicFloat

Source

pub fn log_b(&self) -> (Option<BigInt>, FPState)

get the floor of the log base 2 of the absolute value of self

Source§

impl DynamicFloat

Source

pub fn scale_b( &self, scale: BigInt, rounding_mode: Option<RoundingMode>, ) -> Self

get self * 2^scale

Source§

impl DynamicFloat

Source

pub fn sqrt(&self, rounding_mode: Option<RoundingMode>) -> Self

get the square-root of self

Source§

impl DynamicFloat

Source

pub fn convert_from_dynamic_float( src: &Self, rounding_mode: Option<RoundingMode>, properties: FloatProperties, ) -> Self

convert src to the floating-point format specified by properties.

Source

pub fn convert_from_float<SrcFT: FloatTraits>( src: &Float<SrcFT>, rounding_mode: Option<RoundingMode>, fp_state: Option<FPState>, properties: FloatProperties, ) -> Self

convert src to the floating-point format specified by properties.

Source

pub fn convert_to_dynamic_float( &self, rounding_mode: Option<RoundingMode>, properties: FloatProperties, ) -> Self

convert self to the floating-point format specified by properties.

Source

pub fn abs(&self) -> Self

compute the absolute value of self

Source

pub fn copy_sign<FT2: FloatTraits>(&self, sign_src: &Float<FT2>) -> Self

construct a DynamicFloat from self but with the sign of sign_src

Source

pub fn compare(&self, rhs: &Self, quiet: bool) -> (Option<Ordering>, FPState)

compare two DynamicFloat values

Source

pub fn checked_compare( &self, rhs: &Self, quiet: bool, ) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>

compare two DynamicFloat values

Source

pub fn compare_quiet(&self, rhs: &Self) -> (Option<Ordering>, FPState)

compare two DynamicFloat values

Source

pub fn checked_compare_quiet( &self, rhs: &Self, ) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>

compare two DynamicFloat values

Source

pub fn compare_signaling(&self, rhs: &Self) -> (Option<Ordering>, FPState)

compare two DynamicFloat values

Source

pub fn checked_compare_signaling( &self, rhs: &Self, ) -> Result<(Option<Ordering>, FPState), FPStateMergeFailed>

compare two DynamicFloat values

Source§

impl DynamicFloat

Source

pub fn from_bigint( 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.

Source§

impl DynamicFloat

Source

pub fn from_biguint( 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.

Source§

impl DynamicFloat

Source

pub fn from_u8( 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.

Source§

impl DynamicFloat

Source

pub fn from_u16( 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.

Source§

impl DynamicFloat

Source

pub fn from_u32( 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.

Source§

impl DynamicFloat

Source

pub fn from_u64( 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.

Source§

impl DynamicFloat

Source

pub fn from_u128( 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.

Source§

impl DynamicFloat

Source

pub fn from_usize( 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.

Source§

impl DynamicFloat

Source

pub fn from_i8( 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.

Source§

impl DynamicFloat

Source

pub fn from_i16( 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.

Source§

impl DynamicFloat

Source

pub fn from_i32( 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.

Source§

impl DynamicFloat

Source

pub fn from_i64( 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.

Source§

impl DynamicFloat

Source

pub fn from_i128( 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.

Source§

impl DynamicFloat

Source

pub fn from_isize( 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.

Source§

impl DynamicFloat

Source

pub fn to_bigint( &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

Source§

impl DynamicFloat

Source

pub fn to_biguint( &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

Source§

impl DynamicFloat

Source

pub fn to_u8( &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

Source§

impl DynamicFloat

Source

pub fn to_u16( &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

Source§

impl DynamicFloat

Source

pub fn to_u32( &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

Source§

impl DynamicFloat

Source

pub fn to_u64( &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

Source§

impl DynamicFloat

Source

pub fn to_u128( &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

Source§

impl DynamicFloat

Source

pub fn to_usize( &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

Source§

impl DynamicFloat

Source

pub fn to_i8( &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

Source§

impl DynamicFloat

Source

pub fn to_i16( &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

Source§

impl DynamicFloat

Source

pub fn to_i32( &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

Source§

impl DynamicFloat

Source

pub fn to_i64( &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

Source§

impl DynamicFloat

Source

pub fn to_i128( &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

Source§

impl DynamicFloat

Source

pub fn to_isize( &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

Source§

impl DynamicFloat

Source

pub fn rsqrt(&self, rounding_mode: Option<RoundingMode>) -> Self

compute reciprocal square-root (1.0 / sqrt(self))

Methods from Deref<Target = Float<FloatProperties>>§

Source

pub fn bits(&self) -> &Bits

get the underlying bits

Source

pub fn set_bits(&mut self, bits: Bits)

set the underlying bits

Source

pub fn traits(&self) -> &FT

get the FloatTraits

Source

pub fn properties(&self) -> FloatProperties

get the FloatProperties

Source

pub fn sign(&self) -> Sign

get the sign

Source

pub fn set_sign(&mut self, sign: Sign)

set the sign

Source

pub fn toggle_sign(&mut self)

toggle the sign

Source

pub fn exponent_field(&self) -> Bits

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

Source

pub fn set_exponent_field(&mut self, exponent: Bits)

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

Source

pub fn mantissa_field(&self) -> Bits

get the mantissa field

Source

pub fn set_mantissa_field(&mut self, mantissa: Bits)

set the mantissa field

Source

pub fn mantissa_field_msb(&self) -> bool

get the mantissa field’s MSB

Source

pub fn set_mantissa_field_msb(&mut self, mantissa_msb: bool)

set the mantissa field’s MSB

Source

pub fn class(&self) -> FloatClass

calculate the FloatClass

Source

pub fn is_negative_infinity(&self) -> bool

return true if self.class() is NegativeInfinity

Source

pub fn is_negative_normal(&self) -> bool

return true if self.class() is NegativeNormal

Source

pub fn is_negative_subnormal(&self) -> bool

return true if self.class() is NegativeSubnormal

Source

pub fn is_negative_zero(&self) -> bool

return true if self.class() is NegativeZero

Source

pub fn is_positive_infinity(&self) -> bool

return true if self.class() is PositiveInfinity

Source

pub fn is_positive_normal(&self) -> bool

return true if self.class() is PositiveNormal

Source

pub fn is_positive_subnormal(&self) -> bool

return true if self.class() is PositiveSubnormal

Source

pub fn is_positive_zero(&self) -> bool

return true if self.class() is PositiveZero

Source

pub fn is_quiet_nan(&self) -> bool

return true if self.class() is QuietNaN

Source

pub fn is_signaling_nan(&self) -> bool

return true if self.class() is SignalingNaN

Source

pub fn is_infinity(&self) -> bool

return true if self is infinity

Source

pub fn is_normal(&self) -> bool

return true if self.class() is NegativeNormal or PositiveNormal

Source

pub fn is_subnormal(&self) -> bool

return true if self is subnormal

Source

pub fn is_zero(&self) -> bool

return true if self is zero

Source

pub fn is_nan(&self) -> bool

return true if self is NaN

Source

pub fn is_finite(&self) -> bool

return true if self is finite (not NaN or infinity)

Source

pub fn is_subnormal_or_zero(&self) -> bool

return true if self is subnormal or zero

Source

pub fn to_ratio(&self) -> Option<Ratio<BigInt>>

get the mathematical value of self as a Ratio<BigInt>. if self is NaN or infinite, returns None.

Source

pub fn to_real_algebraic_number(&self) -> Option<RealAlgebraicNumber>

get the mathematical value of self as a RealAlgebraicNumber. if self is NaN or infinite, returns None.

Source

pub fn to_quiet_nan(&self) -> Self

convert self into a quiet NaN

Source

pub fn add( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

add floating-point numbers

Source

pub fn sub( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

subtract floating-point numbers

Source

pub fn mul( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

multiply floating-point numbers

Source

pub fn div( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

divide floating-point numbers

Source

pub fn ieee754_remainder( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

compute the IEEE 754 remainder of two floating-point numbers

Source

pub fn fused_mul_add( &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

Source

pub fn round_to_integer( &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

Source

pub fn round_to_integral( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

round self to an integer, returning the result as a Float

Source

pub fn normalize(&mut self)

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

Source

pub fn next_up_or_down( &self, up_or_down: UpOrDown, fp_state: Option<&mut FPState>, ) -> Self

compute the result of next_up or next_down

Source

pub fn next_up(&self, fp_state: Option<&mut FPState>) -> Self

compute the least floating-point number that compares greater than self

Source

pub fn next_down(&self, fp_state: Option<&mut FPState>) -> Self

compute the greatest floating-point number that compares less than self

Source

pub fn log_b(&self, fp_state: Option<&mut FPState>) -> Option<BigInt>

get the floor of the log base 2 of the absolute value of self

Source

pub fn scale_b( &self, scale: BigInt, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

get self * 2^scale

Source

pub fn sqrt( &self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

get the square-root of self

Source

pub fn convert_to_float_with_traits<DestFT: FloatTraits>( &self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: DestFT, ) -> Float<DestFT>

convert self to the floating-point format specified by traits.

Source

pub fn convert_to_float<DestFT: FloatTraits + Default>( &self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Float<DestFT>

convert self to the floating-point format specified by DestFT::default().

Source

pub fn neg_assign(&mut self)

negate and assign the result back to self. identical to self.toggle_sign()

Source

pub fn neg(&self) -> Self

compute the negation of self

Source

pub fn abs_assign(&mut self)

compute the absolute-value and assign the result back to self. identical to self.set_sign(Sign::Positive)

Source

pub fn abs(&self) -> Self

compute the absolute-value

Source

pub fn copy_sign_assign<FT2: FloatTraits>(&mut self, sign_src: &Float<FT2>)

set self’s sign to the sign of sign_src

Source

pub fn copy_sign<FT2: FloatTraits>(&self, sign_src: &Float<FT2>) -> Self

construct a Float from self but with the sign of sign_src

Source

pub fn compare( &self, rhs: &Self, quiet: bool, fp_state: Option<&mut FPState>, ) -> Option<Ordering>

compare two Float values

Source

pub fn compare_quiet( &self, rhs: &Self, fp_state: Option<&mut FPState>, ) -> Option<Ordering>

compare two Float values

Source

pub fn compare_signaling( &self, rhs: &Self, fp_state: Option<&mut FPState>, ) -> Option<Ordering>

compare two Float values

Source

pub fn to_bigint( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<BigInt>

convert from floating-point to integer

Source

pub fn to_biguint( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<BigUint>

convert from floating-point to integer

Source

pub fn to_u8( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u8>

convert from floating-point to integer

Source

pub fn to_u16( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u16>

convert from floating-point to integer

Source

pub fn to_u32( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u32>

convert from floating-point to integer

Source

pub fn to_u64( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u64>

convert from floating-point to integer

Source

pub fn to_u128( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u128>

convert from floating-point to integer

Source

pub fn to_usize( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<usize>

convert from floating-point to integer

Source

pub fn to_i8( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i8>

convert from floating-point to integer

Source

pub fn to_i16( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i16>

convert from floating-point to integer

Source

pub fn to_i32( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i32>

convert from floating-point to integer

Source

pub fn to_i64( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i64>

convert from floating-point to integer

Source

pub fn to_i128( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i128>

convert from floating-point to integer

Source

pub fn to_isize( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<isize>

convert from floating-point to integer

Source

pub fn rsqrt( &self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self

reciprocal square root – computes 1 / sqrt(self)

Trait Implementations§

Source§

impl<'a, 'b> Add<&'a DynamicFloat> for &'b DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the + operation. Read more
Source§

impl Add<&DynamicFloat> for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the + operation. Read more
Source§

impl Add<DynamicFloat> for &DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the + operator.
Source§

fn add(self, rhs: DynamicFloat) -> DynamicFloat

Performs the + operation. Read more
Source§

impl Add for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the + operator.
Source§

fn add(self, rhs: DynamicFloat) -> DynamicFloat

Performs the + operation. Read more
Source§

impl AddAssign<&DynamicFloat> for DynamicFloat

Source§

fn add_assign(&mut self, rhs: &DynamicFloat)

Performs the += operation. Read more
Source§

impl AddAssign for DynamicFloat

Source§

fn add_assign(&mut self, rhs: DynamicFloat)

Performs the += operation. Read more
Source§

impl Clone for DynamicFloat

Source§

fn clone(&self) -> DynamicFloat

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 DynamicFloat

Source§

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

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

impl Deref for DynamicFloat

Source§

fn deref(&self) -> &Float<FloatProperties>

returns &self.value

Source§

type Target = Float<FloatProperties>

The resulting type after dereferencing.
Source§

impl DerefMut for DynamicFloat

Source§

fn deref_mut(&mut self) -> &mut Float<FloatProperties>

returns &mut self.value

Source§

impl<'a, 'b> Div<&'a DynamicFloat> for &'b DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the / operation. Read more
Source§

impl Div<&DynamicFloat> for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the / operation. Read more
Source§

impl Div<DynamicFloat> for &DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the / operator.
Source§

fn div(self, rhs: DynamicFloat) -> DynamicFloat

Performs the / operation. Read more
Source§

impl Div for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the / operator.
Source§

fn div(self, rhs: DynamicFloat) -> DynamicFloat

Performs the / operation. Read more
Source§

impl DivAssign<&DynamicFloat> for DynamicFloat

Source§

fn div_assign(&mut self, rhs: &DynamicFloat)

Performs the /= operation. Read more
Source§

impl DivAssign for DynamicFloat

Source§

fn div_assign(&mut self, rhs: DynamicFloat)

Performs the /= operation. Read more
Source§

impl From<DynamicFloat> for Float<FloatProperties>

Source§

fn from(value: DynamicFloat) -> Self

Converts to this type from the input type.
Source§

impl From<Float<FloatProperties>> for DynamicFloat

Source§

fn from(value: Float<FloatProperties>) -> Self

Converts to this type from the input type.
Source§

impl<'a, 'b> Mul<&'a DynamicFloat> for &'b DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the * operation. Read more
Source§

impl Mul<&DynamicFloat> for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the * operation. Read more
Source§

impl Mul<DynamicFloat> for &DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: DynamicFloat) -> DynamicFloat

Performs the * operation. Read more
Source§

impl Mul for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: DynamicFloat) -> DynamicFloat

Performs the * operation. Read more
Source§

impl MulAssign<&DynamicFloat> for DynamicFloat

Source§

fn mul_assign(&mut self, rhs: &DynamicFloat)

Performs the *= operation. Read more
Source§

impl MulAssign for DynamicFloat

Source§

fn mul_assign(&mut self, rhs: DynamicFloat)

Performs the *= operation. Read more
Source§

impl Neg for &DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the - operator.
Source§

fn neg(self) -> DynamicFloat

Performs the unary - operation. Read more
Source§

impl Neg for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the - operator.
Source§

fn neg(self) -> DynamicFloat

Performs the unary - operation. Read more
Source§

impl<'a, 'b> Sub<&'a DynamicFloat> for &'b DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the - operation. Read more
Source§

impl Sub<&DynamicFloat> for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &DynamicFloat) -> DynamicFloat

Performs the - operation. Read more
Source§

impl Sub<DynamicFloat> for &DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: DynamicFloat) -> DynamicFloat

Performs the - operation. Read more
Source§

impl Sub for DynamicFloat

Source§

type Output = DynamicFloat

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: DynamicFloat) -> DynamicFloat

Performs the - operation. Read more
Source§

impl SubAssign<&DynamicFloat> for DynamicFloat

Source§

fn sub_assign(&mut self, rhs: &DynamicFloat)

Performs the -= operation. Read more
Source§

impl SubAssign for DynamicFloat

Source§

fn sub_assign(&mut self, rhs: DynamicFloat)

Performs the -= operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.