pub struct d128 { /* private fields */ }Expand description
The 128-bit decimal type.
Implementations§
Source§impl d128
impl d128
Sourcepub fn encode_decimal(&self) -> Self
pub fn encode_decimal(&self) -> Self
Convert a 128-bit decimal floating-point value encoded in BID format to the same value encoded in DPD
Sourcepub fn decode_decimal(&self) -> Self
pub fn decode_decimal(&self) -> Self
Convert a 128-bit decimal floating-point value encoded in DPD format to the same value encoded in BID format
Sourcepub fn abs(&self) -> Self
pub fn abs(&self) -> Self
Copies a 128-bit decimal floating-point operand x to a destination in the same format, changing the sign to positive
Sourcepub fn class(&self) -> ClassTypes
pub fn class(&self) -> ClassTypes
Tells which of the following ten classes x falls into (details in the IEEE Standard 754-2008): signalingNaN, quietNaN, negativeInfinity, negativeNormal, negativeSubnormal, negativeZero, positiveZero, positiveSubnormal, positiveNormal, positiveInfinity
Sourcepub fn copy(&self) -> Self
pub fn copy(&self) -> Self
Copies a decimal floating-point operand x to a destination in the same format, with no change
Sourcepub fn copy_sign(&self, other: &Self) -> Self
pub fn copy_sign(&self, other: &Self) -> Self
Copies a 128-bit decimal floating-point operand x to a destination in the same format as x, but with the sign of y
Sourcepub fn is_canonical(&self) -> bool
pub fn is_canonical(&self) -> bool
Return true if and only if x is a finite number, infinity, or NaN that is canonical
Sourcepub fn is_finite(&self) -> bool
pub fn is_finite(&self) -> bool
Return true if and only if x is zero, subnormal or normal (not infinite or NaN)
Sourcepub fn is_infinite(&self) -> bool
pub fn is_infinite(&self) -> bool
Return true if and only if x is infinite
Sourcepub fn is_normal(&self) -> bool
pub fn is_normal(&self) -> bool
Return true if and only if x is normal (not zero, subnormal, infinite, or NaN)
Sourcepub fn is_signaling(&self) -> bool
pub fn is_signaling(&self) -> bool
Return true if and only if x is a signaling NaN
Sourcepub fn is_sign_minus(&self) -> bool
pub fn is_sign_minus(&self) -> bool
Return true if and only if x has negative sign
Sourcepub fn is_subnormal(&self) -> bool
pub fn is_subnormal(&self) -> bool
Return true if and only if x is subnormal
Sourcepub fn negate(x: &Self) -> Self
pub fn negate(x: &Self) -> Self
Copies a 128-bit decimal floating-point operand x to a destination in the same format, reversing the sign
Sourcepub fn same_quantum(x: &Self, y: &Self) -> bool
pub fn same_quantum(x: &Self, y: &Self) -> bool
same_quantum is true if the exponents of x and y are the same,
and false otherwise; same_quantum(NaN, NaN) and same_quantum(inf, inf) are
true; if exactly one operand is infinite or exactly one operand is NaN,
sameQuantum is false
Sourcepub fn total_order(x: &Self, y: &Self) -> bool
pub fn total_order(x: &Self, y: &Self) -> bool
Return true if the absolute values of x and y are ordered (see the IEEE Standard 754-2008)
Sourcepub fn total_order_mag(x: &Self, y: &Self) -> bool
pub fn total_order_mag(x: &Self, y: &Self) -> bool
Return true if the absolute values of x and y are ordered (see the IEEE Standard 754-2008)
pub fn nan(tagp: &str, pfpsf: &mut _IDEC_flags) -> d128
Sourcepub fn convert_from_decimal_character(
value: &str,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn convert_from_decimal_character( value: &str, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Convert a decimal floating-point value represented in string format (decimal character sequence) to 128-bit decimal floating-point format (binary encoding)
Sourcepub fn convert_from_f32(
value: f32,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn convert_from_f32( value: f32, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Convert 32-bit binary floating-point value to 128-bit decimal floating-point format (binary encoding)
Sourcepub fn convert_from_f64(
value: f64,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn convert_from_f64( value: f64, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Convert 64-bit binary floating-point value to 128-bit decimal floating-point format (binary encoding)
Sourcepub fn fdim(
&self,
rhs: &d128,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn fdim( &self, rhs: &d128, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
fdim returns x - y if x > y, and +0 is x <= y
Sourcepub fn fused_multiply_add(
x: &Self,
y: &Self,
z: &Self,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn fused_multiply_add( x: &Self, y: &Self, z: &Self, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Computes x * y + z as if to infinite precision and rounded only once to fit the result type.
Sourcepub fn fmod(&self, rhs: &d128, pfpsf: &mut _IDEC_flags) -> Self
pub fn fmod(&self, rhs: &d128, pfpsf: &mut _IDEC_flags) -> Self
Computes the decimal floating point remainder of the division operation x / y.
Sourcepub fn frexp(&self) -> (Self, i32)
pub fn frexp(&self) -> (Self, i32)
Decomposes given decimal floating point value num into a normalized fraction and an integral power of two.
Sourcepub fn ldexp(
&self,
n: i32,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn ldexp( &self, n: i32, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
multiply a 128-bit decimal floating-point value by an integral power of 2.
Sourcepub fn llquantexp(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn llquantexp(&self, pfpsf: &mut _IDEC_flags) -> i64
The llquantexp() functions return the quantum exponent of x.
Sourcepub fn logb(&self, pfpsf: &mut _IDEC_flags) -> Self
pub fn logb(&self, pfpsf: &mut _IDEC_flags) -> Self
Returns the exponent e of x, a signed integral value, determined as though x were represented with infinite range and minimum exponent
Sourcepub fn lrint(
&self,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> i64
pub fn lrint( &self, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> i64
The lrint function rounds its argument to the nearest integer value of type long int, rounding according to the current rounding direction.
Sourcepub fn llrint(
&self,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> i64
pub fn llrint( &self, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> i64
The llrint function rounds its argument to the nearest integer value of type long long int, rounding according to the current rounding direction.
Sourcepub fn lround(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn lround(&self, pfpsf: &mut _IDEC_flags) -> i64
The lround function rounds its argument to the nearest integer value of type long int, using rounding to nearest-away
Sourcepub fn llround(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn llround(&self, pfpsf: &mut _IDEC_flags) -> i64
The llround function rounds its argument to the nearest integer value of type long int, using rounding to nearest-away
Sourcepub fn log_b(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn log_b(&self, pfpsf: &mut _IDEC_flags) -> i32
Returns the exponent e of x, a signed integral value, determined as though x were represented with infinite range and minimum exponent
Sourcepub fn max_num(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
pub fn max_num(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
Returns the canonicalized floating-point number y if x < y, x if y < x, the canonicalized floating-point number if one operand is a floating-point number and the other a quiet NaN.
Sourcepub fn max_num_mag(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
pub fn max_num_mag(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
Returns the canonicalized floating-point number x if |x| > |y|,
y if |y| > |x|, otherwise this function is identical to max
Sourcepub fn min_num(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
pub fn min_num(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
Returns the canonicalized floating-point number x if x < y, y if y < x, the canonicalized floating-point number if one operand is a floating-point number and the other a quiet NaN. Otherwise it is either x or y, canonicalized.
Sourcepub fn min_num_mag(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
pub fn min_num_mag(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
Returns the canonicalized floating-point number x if |x| < |y|,
y if |y| < |x|, otherwise this function is identical to min
Sourcepub fn modf(&self, pfpsf: &mut _IDEC_flags) -> (Self, Self)
pub fn modf(&self, pfpsf: &mut _IDEC_flags) -> (Self, Self)
Decomposes given decimal floating point value num into integral and fractional parts.
Sourcepub fn nearbyint(
&self,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn nearbyint( &self, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Rounds the decimal floating-point value num to an integer value in decicmal floating-point format, using the given rounding mode.
Sourcepub fn next_after(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
pub fn next_after(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
Returns the next 128-bit decimal floating-point number that neighbors the first operand in the direction toward the second operand
Sourcepub fn next_down(&self, pfpsf: &mut _IDEC_flags) -> Self
pub fn next_down(&self, pfpsf: &mut _IDEC_flags) -> Self
Returns the greatest 128-bit decimal floating-point number that compares less than the operand
Sourcepub fn next_toward(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
pub fn next_toward(x: &Self, y: &Self, pfpsf: &mut _IDEC_flags) -> Self
Returns the next representable value after x in the direction of y.
Sourcepub fn next_up(&self, pfpsf: &mut _IDEC_flags) -> Self
pub fn next_up(&self, pfpsf: &mut _IDEC_flags) -> Self
Returns the least 128-bit decimal floating-point number that compares greater than the operand
Sourcepub fn quantexp(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn quantexp(&self, pfpsf: &mut _IDEC_flags) -> i32
The quantexp() functions return the quantum exponent of x.
Sourcepub fn quantize(
x: &Self,
y: &Self,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn quantize( x: &Self, y: &Self, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
quantize is a floating-point number in the same format that
has, if possible, the same numerical value as x and the same quantum
(unit-in-the-last-place) as y. If the exponent is being increased, rounding
according to the prevailing rounding-direction mode might occur: the result
is a different floating-point representation and inexact is signaled if the
result does not have the same numerical value as x. If the exponent is being
decreased and the significand of the result would have more than 34 digits,
invalid is signaled and the result is NaN. If one or both operands are NaN
the rules for NaNs are followed. Otherwise if only one operand is
infinite then invalid is signaled and the result is NaN. If both operands
are infinite then the result is canonical infinity with the sign of x
Sourcepub fn quantum(&self) -> Self
pub fn quantum(&self) -> Self
The quantum functions compute the quantum of a finite argument.
If x is infinite, the result is +Inf. If x is NaN, the result is NaN.
Sourcepub fn scaleb(
&self,
n: i32,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn scaleb( &self, n: i32, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Returns x * 10^N
Sourcepub fn scalebln(
&self,
n: i64,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn scalebln( &self, n: i64, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Returns x * 10^N
Sourcepub fn square_root(
&self,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> Self
pub fn square_root( &self, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self
Decimal floating-point square root
Sourcepub fn convert_to_i32_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-to-nearest-even mode; inexact exceptions not signaled
Sourcepub fn convert_to_i32_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-to-nearest-even mode; inexact exceptions signaled
Sourcepub fn convert_to_i32_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-down mode; inexact exceptions not signaled
Sourcepub fn convert_to_i32_exact_toward_negative(
&self,
pfpsf: &mut _IDEC_flags,
) -> i32
pub fn convert_to_i32_exact_toward_negative( &self, pfpsf: &mut _IDEC_flags, ) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-down mode; inexact exceptions signaled
Sourcepub fn convert_to_i32_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-up mode; inexact exceptions not signaled
Sourcepub fn convert_to_i32_exact_toward_positive(
&self,
pfpsf: &mut _IDEC_flags,
) -> i32
pub fn convert_to_i32_exact_toward_positive( &self, pfpsf: &mut _IDEC_flags, ) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-up mode; inexact exceptions signaled
Sourcepub fn convert_to_i32_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-to-zero; inexact exceptions not signaled
Sourcepub fn convert_to_i32_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-to-zero; inexact exceptions signale
Sourcepub fn convert_to_i32_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-to-nearest-away; inexact exceptions not signaled
Sourcepub fn convert_to_i32_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i32
pub fn convert_to_i32_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i32
Convert 128-bit decimal floating-point value to 32-bit signed integer in rounding-to-nearest-away; inexact exceptions signaled
Sourcepub fn convert_to_i64_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-up mode; inexact exceptions not signaled
Sourcepub fn convert_to_i64_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-down mode; inexact exceptions not signaled
Sourcepub fn convert_to_i64_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-to-zero; inexact exceptions not signaled
Sourcepub fn convert_to_i64_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-to-nearest-even mode; inexact exceptions not signaled
Sourcepub fn convert_to_i64_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-to-nearest-away; inexact exceptions not signaled
Sourcepub fn convert_to_i64_exact_toward_positive(
&self,
pfpsf: &mut _IDEC_flags,
) -> i64
pub fn convert_to_i64_exact_toward_positive( &self, pfpsf: &mut _IDEC_flags, ) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-up mode; inexact exceptions signaled
Sourcepub fn convert_to_i64_exact_toward_negative(
&self,
pfpsf: &mut _IDEC_flags,
) -> i64
pub fn convert_to_i64_exact_toward_negative( &self, pfpsf: &mut _IDEC_flags, ) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-down mode; inexact exceptions signaled
Sourcepub fn convert_to_i64_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-to-zero; inexact exceptions signaled
Sourcepub fn convert_to_i64_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-to-nearest-even mode; inexact exceptions signaled
Sourcepub fn convert_to_i64_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i64
pub fn convert_to_i64_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> i64
Convert 128-bit decimal floating-point value to 64-bit signed integer in rounding-to-nearest-away; inexact exceptions signaled
Sourcepub fn convert_to_u32_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-up mode; inexact exceptions not signaled
Sourcepub fn convert_to_u32_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-down mode; inexact exceptions not signaled
Sourcepub fn convert_to_u32_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-to-zero; inexact exceptions not signaled
Sourcepub fn convert_to_u32_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-to-nearest-even mode; inexact exceptions not signaled
Sourcepub fn convert_to_u32_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-to-nearest-away; inexact exceptions not signaled
Sourcepub fn convert_to_u32_exact_toward_positive(
&self,
pfpsf: &mut _IDEC_flags,
) -> u32
pub fn convert_to_u32_exact_toward_positive( &self, pfpsf: &mut _IDEC_flags, ) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-up mode; inexact exceptions signaled
Sourcepub fn convert_to_u32_exact_toward_negative(
&self,
pfpsf: &mut _IDEC_flags,
) -> u32
pub fn convert_to_u32_exact_toward_negative( &self, pfpsf: &mut _IDEC_flags, ) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-down mode; inexact exceptions signaled
Sourcepub fn convert_to_u32_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-to-zero; inexact exceptions signaled
Sourcepub fn convert_to_u32_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-to-nearest-even mode; inexact exceptions signaled
Sourcepub fn convert_to_u32_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u32
pub fn convert_to_u32_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u32
Convert 128-bit decimal floating-point value to 32-bit unsigned integer in rounding-to-nearest-away; inexact exceptions signaled
Sourcepub fn convert_to_u64_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_toward_positive(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-up mode; inexact exceptions not signaled
Sourcepub fn convert_to_u64_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_toward_negative(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-down mode; inexact exceptions not signaled
Sourcepub fn convert_to_u64_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-to-zero; inexact exceptions not signaled
Sourcepub fn convert_to_u64_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-to-nearest-even mode; inexact exceptions not signaled
Sourcepub fn convert_to_u64_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-to-nearest-away; inexact exceptions not signaled
Sourcepub fn convert_to_u64_exact_toward_positive(
&self,
pfpsf: &mut _IDEC_flags,
) -> u64
pub fn convert_to_u64_exact_toward_positive( &self, pfpsf: &mut _IDEC_flags, ) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-up mode; inexact exceptions signaled
Sourcepub fn convert_to_u64_exact_toward_negative(
&self,
pfpsf: &mut _IDEC_flags,
) -> u64
pub fn convert_to_u64_exact_toward_negative( &self, pfpsf: &mut _IDEC_flags, ) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-down mode; inexact exceptions signaled
Sourcepub fn convert_to_u64_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_exact_toward_zero(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-to-zero; inexact exceptions signaled
Sourcepub fn convert_to_u64_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_exact_ties_to_even(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-to-nearest-even mode; inexact exceptions signaled
Sourcepub fn convert_to_u64_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u64
pub fn convert_to_u64_exact_ties_to_away(&self, pfpsf: &mut _IDEC_flags) -> u64
Convert 128-bit decimal floating-point value to 64-bit unsigned integer in rounding-to-nearest-away; inexact exceptions signaled
Sourcepub fn addition(
lhs: &Self,
rhs: &Self,
rnd_mode: Option<RoundingMode>,
status: &mut _IDEC_flags,
) -> Self
pub fn addition( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self
Decimal floating-point addition, d128 + d128 -> d128
Sourcepub fn division(
lhs: &Self,
rhs: &Self,
rnd_mode: Option<RoundingMode>,
status: &mut _IDEC_flags,
) -> Self
pub fn division( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self
Decimal floating-point division, d128 / d128 -> d128
Sourcepub fn multiplication(
lhs: &Self,
rhs: &Self,
rnd_mode: Option<RoundingMode>,
status: &mut _IDEC_flags,
) -> Self
pub fn multiplication( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self
Decimal floating-point multiplication, d128 / d128 -> d128
Sourcepub fn remainder(lhs: &Self, rhs: &Self, status: &mut _IDEC_flags) -> Self
pub fn remainder(lhs: &Self, rhs: &Self, status: &mut _IDEC_flags) -> Self
Decimal floating-point remainder
Sourcepub fn subtraction(
lhs: &Self,
rhs: &Self,
rnd_mode: Option<RoundingMode>,
status: &mut _IDEC_flags,
) -> Self
pub fn subtraction( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self
Decimal floating-point subtraction, d128 - d128 -> d128
Sourcepub fn compare_quiet_equal(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_equal( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_greater(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_greater( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_unordered(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_unordered( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_ordered(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_ordered( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_greater_equal(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_greater_equal( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_greater_unordered(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_greater_unordered( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_less(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_less( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_less_equal(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_less_equal( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_less_unordered(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_less_unordered( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_not_equal(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_not_equal( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_not_greater(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_not_greater( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_quiet_not_less(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_quiet_not_less( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_greater(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_greater( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_greater_equal(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_greater_equal( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_greater_unordered(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_greater_unordered( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_less(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_less( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_less_equal(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_less_equal( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_less_unordered(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_less_unordered( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_not_greater(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_not_greater( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn compare_signaling_not_less(
lhs: &Self,
rhs: &Self,
status: &mut _IDEC_flags,
) -> bool
pub fn compare_signaling_not_less( lhs: &Self, rhs: &Self, status: &mut _IDEC_flags, ) -> bool
Compare 128-bit decimal floating-point numbers for specified relation; do not signal invalid exception for quiet NaNs
Sourcepub fn round_to_integral_exact(
x: &d128,
rnd_mode: Option<RoundingMode>,
pfpsf: &mut _IDEC_flags,
) -> d128
pub fn round_to_integral_exact( x: &d128, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> d128
Round 128-bit decimal floating-point value to integral-valued decimal floating-point value in the same format, using the current rounding mode; signal inexact exceptions
Sourcepub fn round_to_integral_ties_to_away(x: &d128, pfpsf: &mut _IDEC_flags) -> d128
pub fn round_to_integral_ties_to_away(x: &d128, pfpsf: &mut _IDEC_flags) -> d128
Round 128-bit decimal floating-point value to integral-valued decimal floating-point value in the same format, using the rounding-to-nearest-away mode; do not signal inexact exceptions
Sourcepub fn round_to_integral_ties_to_even(x: &d128, pfpsf: &mut _IDEC_flags) -> d128
pub fn round_to_integral_ties_to_even(x: &d128, pfpsf: &mut _IDEC_flags) -> d128
Round 128-bit decimal floating-point value to integral-valued decimal floating-point value in the same format, using the rounding-to-nearest-even mode; do not signal inexact exceptions
Sourcepub fn round_to_integral_ties_toward_negative(
x: &d128,
pfpsf: &mut _IDEC_flags,
) -> d128
pub fn round_to_integral_ties_toward_negative( x: &d128, pfpsf: &mut _IDEC_flags, ) -> d128
Round 128-bit decimal floating-point value to integral-valued decimal floating-point value in the same format, using the rounding-down mode; do not signal inexact exceptions
Sourcepub fn round_to_integral_ties_toward_positive(
x: &d128,
pfpsf: &mut _IDEC_flags,
) -> d128
pub fn round_to_integral_ties_toward_positive( x: &d128, pfpsf: &mut _IDEC_flags, ) -> d128
Round 128-bit decimal floating-point value to integral-valued decimal floating-point value in the same format, using the rounding-up mode; do not signal inexact exceptions
Sourcepub fn round_to_integral_ties_toward_zero(
x: &d128,
pfpsf: &mut _IDEC_flags,
) -> d128
pub fn round_to_integral_ties_toward_zero( x: &d128, pfpsf: &mut _IDEC_flags, ) -> d128
Round 128-bit decimal floating-point value to integral-valued decimal floating-point value in the same format, using the rounding-to-zero mode; do not signal inexact exceptions
Trait Implementations§
Source§impl Add for d128
impl Add for d128
Source§impl AddAssign<&d128> for d128
impl AddAssign<&d128> for d128
Source§fn add_assign(&mut self, other: &d128)
fn add_assign(&mut self, other: &d128)
+= operation. Read moreSource§impl AddAssign for d128
impl AddAssign for d128
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the += operation.
§Examples
use decmathlib_rs::d128::RoundingMode;
let mut dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
dec1 += dec2;Source§impl Div for d128
impl Div for d128
Source§impl DivAssign<&d128> for d128
impl DivAssign<&d128> for d128
Source§fn div_assign(&mut self, other: &d128)
fn div_assign(&mut self, other: &d128)
/= operation. Read moreSource§impl DivAssign for d128
impl DivAssign for d128
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the /= operation.
§Examples
use decmathlib_rs::d128::RoundingMode;
let mut dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
dec1 /= dec2;Source§impl Hash for d128
impl Hash for d128
Source§fn hash<H: Hasher>(&self, state: &mut H)
fn hash<H: Hasher>(&self, state: &mut H)
Computes the hash of a decimal floating point number.
use std::hash::{DefaultHasher, Hash, Hasher};
let mut hasher = DefaultHasher::new();
decmathlib_rs::dec128!(7920).hash(&mut hasher);
assert_eq!(6912922690305470905, hasher.finish());Source§fn hash_slice<H: Hasher>(data: &[d128], state: &mut H)
fn hash_slice<H: Hasher>(data: &[d128], state: &mut H)
Computes the hash of a sequence of decimal floating point numbers.
use std::hash::{DefaultHasher, Hash, Hasher};
let mut hasher = DefaultHasher::new();
let numbers = [decmathlib_rs::dec128!(6), decmathlib_rs::dec128!(28), decmathlib_rs::dec128!(496), decmathlib_rs::dec128!(8128)];
Hash::hash_slice(&numbers, &mut hasher);
assert_eq!(16555189424726162492, hasher.finish());Source§impl Mul for d128
impl Mul for d128
Source§impl MulAssign<&d128> for d128
impl MulAssign<&d128> for d128
Source§fn mul_assign(&mut self, other: &d128)
fn mul_assign(&mut self, other: &d128)
*= operation. Read moreSource§impl MulAssign for d128
impl MulAssign for d128
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the *= operation.
§Examples
use decmathlib_rs::d128::RoundingMode;
let mut dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
dec1 *= dec2;Source§impl PartialOrd for d128
impl PartialOrd for d128
Source§impl Rem for d128
impl Rem for d128
Source§impl RemAssign<&d128> for d128
impl RemAssign<&d128> for d128
Source§fn rem_assign(&mut self, other: &d128)
fn rem_assign(&mut self, other: &d128)
%= operation. Read moreSource§impl RemAssign for d128
impl RemAssign for d128
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the %= operation.
§Examples
use decmathlib_rs::d128::RoundingMode;
let mut dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
dec1 %= dec2;Source§impl Sub for d128
impl Sub for d128
Source§impl SubAssign<&d128> for d128
impl SubAssign<&d128> for d128
Source§fn sub_assign(&mut self, other: &d128)
fn sub_assign(&mut self, other: &d128)
-= operation. Read moreSource§impl SubAssign for d128
impl SubAssign for d128
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the *= operation.
§Examples
use decmathlib_rs::d128::RoundingMode;
let mut dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
dec1 -= dec2;