pub struct Float<FT: FloatTraits> { /* private fields */ }
Expand description
the floating-point type with the specified FloatTraits
Implementations§
Source§impl<Bits: FloatBitsType, FT: FloatTraits<Bits = Bits>> Float<FT>
impl<Bits: FloatBitsType, FT: FloatTraits<Bits = Bits>> Float<FT>
Sourcepub fn from_bits_and_traits(bits: Bits, traits: FT) -> Self
pub fn from_bits_and_traits(bits: Bits, traits: FT) -> Self
construct Float
from bits
Sourcepub fn into_bits_and_traits(self) -> (Bits, FT)
pub fn into_bits_and_traits(self) -> (Bits, FT)
get the bits and FloatTraits
Sourcepub fn into_traits(self) -> FT
pub fn into_traits(self) -> FT
get the FloatTraits
Sourcepub fn properties(&self) -> FloatProperties
pub fn properties(&self) -> FloatProperties
get the FloatProperties
Sourcepub fn toggle_sign(&mut self)
pub fn toggle_sign(&mut self)
toggle the sign
Sourcepub fn exponent_field(&self) -> Bits
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
Sourcepub fn set_exponent_field(&mut self, exponent: Bits)
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
Sourcepub fn mantissa_field(&self) -> Bits
pub fn mantissa_field(&self) -> Bits
get the mantissa field
Sourcepub fn set_mantissa_field(&mut self, mantissa: Bits)
pub fn set_mantissa_field(&mut self, mantissa: Bits)
set the mantissa field
Sourcepub fn mantissa_field_msb(&self) -> bool
pub fn mantissa_field_msb(&self) -> bool
get the mantissa field’s MSB
Sourcepub fn set_mantissa_field_msb(&mut self, mantissa_msb: bool)
pub fn set_mantissa_field_msb(&mut self, mantissa_msb: bool)
set the mantissa field’s MSB
Sourcepub fn class(&self) -> FloatClass
pub fn class(&self) -> FloatClass
calculate the FloatClass
Sourcepub fn is_negative_infinity(&self) -> bool
pub fn is_negative_infinity(&self) -> bool
return true
if self.class()
is NegativeInfinity
Sourcepub fn is_negative_normal(&self) -> bool
pub fn is_negative_normal(&self) -> bool
return true
if self.class()
is NegativeNormal
Sourcepub fn is_negative_subnormal(&self) -> bool
pub fn is_negative_subnormal(&self) -> bool
return true
if self.class()
is NegativeSubnormal
Sourcepub fn is_negative_zero(&self) -> bool
pub fn is_negative_zero(&self) -> bool
return true
if self.class()
is NegativeZero
Sourcepub fn is_positive_infinity(&self) -> bool
pub fn is_positive_infinity(&self) -> bool
return true
if self.class()
is PositiveInfinity
Sourcepub fn is_positive_normal(&self) -> bool
pub fn is_positive_normal(&self) -> bool
return true
if self.class()
is PositiveNormal
Sourcepub fn is_positive_subnormal(&self) -> bool
pub fn is_positive_subnormal(&self) -> bool
return true
if self.class()
is PositiveSubnormal
Sourcepub fn is_positive_zero(&self) -> bool
pub fn is_positive_zero(&self) -> bool
return true
if self.class()
is PositiveZero
Sourcepub fn is_quiet_nan(&self) -> bool
pub fn is_quiet_nan(&self) -> bool
return true
if self.class()
is QuietNaN
Sourcepub fn is_signaling_nan(&self) -> bool
pub fn is_signaling_nan(&self) -> bool
return true
if self.class()
is SignalingNaN
Sourcepub fn is_infinity(&self) -> bool
pub fn is_infinity(&self) -> bool
return true
if self
is infinity
Sourcepub fn is_normal(&self) -> bool
pub fn is_normal(&self) -> bool
return true
if self.class()
is NegativeNormal
or PositiveNormal
Sourcepub fn is_subnormal(&self) -> bool
pub fn is_subnormal(&self) -> bool
return true
if self
is subnormal
Sourcepub fn is_subnormal_or_zero(&self) -> bool
pub fn is_subnormal_or_zero(&self) -> bool
return true
if self
is subnormal or zero
Sourcepub fn to_ratio(&self) -> Option<Ratio<BigInt>>
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
.
Sourcepub fn to_real_algebraic_number(&self) -> Option<RealAlgebraicNumber>
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
.
Sourcepub fn positive_zero_with_traits(traits: FT) -> Self
pub fn positive_zero_with_traits(traits: FT) -> Self
get the positive zero value
Sourcepub fn positive_zero() -> Selfwhere
FT: Default,
pub fn positive_zero() -> Selfwhere
FT: Default,
get the positive zero value
Sourcepub fn negative_zero_with_traits(traits: FT) -> Self
pub fn negative_zero_with_traits(traits: FT) -> Self
get the negative zero value
Sourcepub fn negative_zero() -> Selfwhere
FT: Default,
pub fn negative_zero() -> Selfwhere
FT: Default,
get the negative zero value
Sourcepub fn signed_zero_with_traits(sign: Sign, traits: FT) -> Self
pub fn signed_zero_with_traits(sign: Sign, traits: FT) -> Self
get the zero with sign sign
Sourcepub fn signed_zero(sign: Sign) -> Selfwhere
FT: Default,
pub fn signed_zero(sign: Sign) -> Selfwhere
FT: Default,
get the zero with sign sign
Sourcepub fn positive_infinity_with_traits(traits: FT) -> Self
pub fn positive_infinity_with_traits(traits: FT) -> Self
get the positive infinity value
Sourcepub fn positive_infinity() -> Selfwhere
FT: Default,
pub fn positive_infinity() -> Selfwhere
FT: Default,
get the positive infinity value
Sourcepub fn negative_infinity_with_traits(traits: FT) -> Self
pub fn negative_infinity_with_traits(traits: FT) -> Self
get the negative infinity value
Sourcepub fn negative_infinity() -> Selfwhere
FT: Default,
pub fn negative_infinity() -> Selfwhere
FT: Default,
get the negative infinity value
Sourcepub fn signed_infinity_with_traits(sign: Sign, traits: FT) -> Self
pub fn signed_infinity_with_traits(sign: Sign, traits: FT) -> Self
get the infinity with sign sign
Sourcepub fn signed_infinity(sign: Sign) -> Selfwhere
FT: Default,
pub fn signed_infinity(sign: Sign) -> Selfwhere
FT: Default,
get the infinity with sign sign
Sourcepub fn quiet_nan_with_traits(traits: FT) -> Self
pub fn quiet_nan_with_traits(traits: FT) -> Self
get the canonical quiet NaN, which is also just the canonical NaN
Sourcepub fn quiet_nan() -> Selfwhere
FT: Default,
pub fn quiet_nan() -> Selfwhere
FT: Default,
get the canonical quiet NaN, which is also just the canonical NaN
Sourcepub fn signaling_nan_with_traits(traits: FT) -> Self
pub fn signaling_nan_with_traits(traits: FT) -> Self
get the canonical signaling NaN
Sourcepub fn signaling_nan() -> Selfwhere
FT: Default,
pub fn signaling_nan() -> Selfwhere
FT: Default,
get the canonical signaling NaN
Sourcepub fn into_quiet_nan(self) -> Self
pub fn into_quiet_nan(self) -> Self
convert self
into a quiet NaN
Sourcepub fn to_quiet_nan(&self) -> Self
pub fn to_quiet_nan(&self) -> Self
convert self
into a quiet NaN
Sourcepub fn signed_max_normal_with_traits(sign: Sign, traits: FT) -> Self
pub fn signed_max_normal_with_traits(sign: Sign, traits: FT) -> Self
get the largest finite value with sign sign
Sourcepub fn signed_max_normal(sign: Sign) -> Selfwhere
FT: Default,
pub fn signed_max_normal(sign: Sign) -> Selfwhere
FT: Default,
get the largest finite value with sign sign
Sourcepub fn signed_min_subnormal_with_traits(sign: Sign, traits: FT) -> Self
pub fn signed_min_subnormal_with_traits(sign: Sign, traits: FT) -> Self
get the subnormal value closest to zero with sign sign
Sourcepub fn signed_min_subnormal(sign: Sign) -> Selfwhere
FT: Default,
pub fn signed_min_subnormal(sign: Sign) -> Selfwhere
FT: Default,
get the subnormal value closest to zero with sign sign
Sourcepub fn from_real_algebraic_number_with_traits(
value: &RealAlgebraicNumber,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_real_algebraic_number_with_traits( value: &RealAlgebraicNumber, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
round from a RealAlgebraicNumber
into a floating-point value.
Sourcepub fn from_real_algebraic_number(
value: &RealAlgebraicNumber,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_real_algebraic_number(
value: &RealAlgebraicNumber,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
round from a RealAlgebraicNumber
into a floating-point value.
Sourcepub fn add(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
pub fn add( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self
add floating-point numbers
Sourcepub fn sub(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
pub fn sub( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self
subtract floating-point numbers
Sourcepub fn mul(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
pub fn mul( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self
multiply floating-point numbers
Sourcepub fn div(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
pub fn div( &self, rhs: &Self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self
divide floating-point numbers
Sourcepub fn ieee754_remainder(
&self,
rhs: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
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
Sourcepub fn fused_mul_add(
&self,
factor: &Self,
term: &Self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
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
Sourcepub fn round_to_integer(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<BigInt>
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
Sourcepub fn round_to_integral(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
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
Sourcepub fn normalize(&mut self)
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).
Sourcepub fn next_up_or_down(
&self,
up_or_down: UpOrDown,
fp_state: Option<&mut FPState>,
) -> Self
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
Sourcepub fn next_up(&self, fp_state: Option<&mut FPState>) -> Self
pub fn next_up(&self, fp_state: Option<&mut FPState>) -> Self
compute the least floating-point number that compares greater than self
Sourcepub fn next_down(&self, fp_state: Option<&mut FPState>) -> Self
pub fn next_down(&self, fp_state: Option<&mut FPState>) -> Self
compute the greatest floating-point number that compares less than self
Sourcepub fn log_b(&self, fp_state: Option<&mut FPState>) -> Option<BigInt>
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
Sourcepub fn scale_b(
&self,
scale: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
pub fn scale_b( &self, scale: BigInt, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self
get self * 2^scale
Sourcepub fn sqrt(
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Self
pub fn sqrt( &self, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Self
get the square-root of self
Sourcepub fn convert_from_float_with_traits<SrcFT: FloatTraits>(
src: &Float<SrcFT>,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn convert_from_float_with_traits<SrcFT: FloatTraits>( src: &Float<SrcFT>, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert src
to the floating-point format specified by traits
.
Sourcepub fn convert_from_float<SrcFT: FloatTraits>(
src: &Float<SrcFT>,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn convert_from_float<SrcFT: FloatTraits>(
src: &Float<SrcFT>,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert src
to the floating-point format specified by FT::default()
where Self
is Float<FT>
.
Sourcepub fn convert_to_float_with_traits<DestFT: FloatTraits>(
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: DestFT,
) -> Float<DestFT>
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
.
Sourcepub fn convert_to_float<DestFT: FloatTraits + Default>(
&self,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Float<DestFT>
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()
.
Sourcepub fn neg_assign(&mut self)
pub fn neg_assign(&mut self)
negate and assign the result back to self
.
identical to self.toggle_sign()
Sourcepub fn abs_assign(&mut self)
pub fn abs_assign(&mut self)
compute the absolute-value and assign the result back to self
.
identical to self.set_sign(Sign::Positive)
Sourcepub fn copy_sign_assign<FT2: FloatTraits>(&mut self, sign_src: &Float<FT2>)
pub fn copy_sign_assign<FT2: FloatTraits>(&mut self, sign_src: &Float<FT2>)
set self
’s sign to the sign of sign_src
Sourcepub fn copy_sign<FT2: FloatTraits>(&self, sign_src: &Float<FT2>) -> Self
pub fn copy_sign<FT2: FloatTraits>(&self, sign_src: &Float<FT2>) -> Self
construct a Float
from self
but with the sign of sign_src
Sourcepub fn compare(
&self,
rhs: &Self,
quiet: bool,
fp_state: Option<&mut FPState>,
) -> Option<Ordering>
pub fn compare( &self, rhs: &Self, quiet: bool, fp_state: Option<&mut FPState>, ) -> Option<Ordering>
compare two Float
values
Sourcepub fn compare_quiet(
&self,
rhs: &Self,
fp_state: Option<&mut FPState>,
) -> Option<Ordering>
pub fn compare_quiet( &self, rhs: &Self, fp_state: Option<&mut FPState>, ) -> Option<Ordering>
compare two Float
values
Sourcepub fn compare_signaling(
&self,
rhs: &Self,
fp_state: Option<&mut FPState>,
) -> Option<Ordering>
pub fn compare_signaling( &self, rhs: &Self, fp_state: Option<&mut FPState>, ) -> Option<Ordering>
compare two Float
values
Sourcepub fn from_bigint_with_traits(
value: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_bigint_with_traits( value: BigInt, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_bigint(
value: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_bigint(
value: BigInt,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_biguint_with_traits(
value: BigUint,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_biguint_with_traits( value: BigUint, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_biguint(
value: BigUint,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_biguint(
value: BigUint,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_u8_with_traits(
value: u8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_u8_with_traits( value: u8, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_u8(
value: u8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_u8(
value: u8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_u16_with_traits(
value: u16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_u16_with_traits( value: u16, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_u16(
value: u16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_u16(
value: u16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_u32_with_traits(
value: u32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_u32_with_traits( value: u32, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_u32(
value: u32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_u32(
value: u32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_u64_with_traits(
value: u64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_u64_with_traits( value: u64, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_u64(
value: u64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_u64(
value: u64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_u128_with_traits(
value: u128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_u128_with_traits( value: u128, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_u128(
value: u128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_u128(
value: u128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_usize_with_traits(
value: usize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_usize_with_traits( value: usize, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_usize(
value: usize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_usize(
value: usize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_i8_with_traits(
value: i8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_i8_with_traits( value: i8, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_i8(
value: i8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_i8(
value: i8,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_i16_with_traits(
value: i16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_i16_with_traits( value: i16, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_i16(
value: i16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_i16(
value: i16,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_i32_with_traits(
value: i32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_i32_with_traits( value: i32, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_i32(
value: i32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_i32(
value: i32,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_i64_with_traits(
value: i64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_i64_with_traits( value: i64, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_i64(
value: i64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_i64(
value: i64,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_i128_with_traits(
value: i128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_i128_with_traits( value: i128, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_i128(
value: i128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_i128(
value: i128,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn from_isize_with_traits(
value: isize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
traits: FT,
) -> Self
pub fn from_isize_with_traits( value: isize, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, traits: FT, ) -> Self
convert from integer to floating-point
Sourcepub fn from_isize(
value: isize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
pub fn from_isize(
value: isize,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Selfwhere
FT: Default,
convert from integer to floating-point
Sourcepub fn to_bigint(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<BigInt>
pub fn to_bigint( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<BigInt>
convert from floating-point to integer
Sourcepub fn to_biguint(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<BigUint>
pub fn to_biguint( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<BigUint>
convert from floating-point to integer
Sourcepub fn to_u8(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<u8>
pub fn to_u8( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u8>
convert from floating-point to integer
Sourcepub fn to_u16(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<u16>
pub fn to_u16( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u16>
convert from floating-point to integer
Sourcepub fn to_u32(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<u32>
pub fn to_u32( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u32>
convert from floating-point to integer
Sourcepub fn to_u64(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<u64>
pub fn to_u64( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u64>
convert from floating-point to integer
Sourcepub fn to_u128(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<u128>
pub fn to_u128( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<u128>
convert from floating-point to integer
Sourcepub fn to_usize(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<usize>
pub fn to_usize( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<usize>
convert from floating-point to integer
Sourcepub fn to_i8(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<i8>
pub fn to_i8( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i8>
convert from floating-point to integer
Sourcepub fn to_i16(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<i16>
pub fn to_i16( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i16>
convert from floating-point to integer
Sourcepub fn to_i32(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<i32>
pub fn to_i32( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i32>
convert from floating-point to integer
Sourcepub fn to_i64(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<i64>
pub fn to_i64( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i64>
convert from floating-point to integer
Sourcepub fn to_i128(
&self,
exact: bool,
rounding_mode: Option<RoundingMode>,
fp_state: Option<&mut FPState>,
) -> Option<i128>
pub fn to_i128( &self, exact: bool, rounding_mode: Option<RoundingMode>, fp_state: Option<&mut FPState>, ) -> Option<i128>
convert from floating-point to integer