d128

Struct d128 

Source
pub struct d128 { /* private fields */ }
Expand description

The 128-bit decimal type.

Implementations§

Source§

impl d128

Source

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

Source

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

Source

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

Source

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

Source

pub fn copy(&self) -> Self

Copies a decimal floating-point operand x to a destination in the same format, with no change

Source

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

Source

pub fn is_canonical(&self) -> bool

Return true if and only if x is a finite number, infinity, or NaN that is canonical

Source

pub fn is_finite(&self) -> bool

Return true if and only if x is zero, subnormal or normal (not infinite or NaN)

Source

pub fn is_infinite(&self) -> bool

Return true if and only if x is infinite

Source

pub fn is_nan(&self) -> bool

Return true if and only if x is a NaN

Source

pub fn is_normal(&self) -> bool

Return true if and only if x is normal (not zero, subnormal, infinite, or NaN)

Source

pub fn is_signaling(&self) -> bool

Return true if and only if x is a signaling NaN

Source

pub fn is_sign_minus(&self) -> bool

Return true if and only if x has negative sign

Source

pub fn is_subnormal(&self) -> bool

Return true if and only if x is subnormal

Source

pub fn is_zero(&self) -> bool

Return true if and only if x is +0 or -0

Source

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

Source

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

Source

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)

Source

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)

Source

pub fn nan(tagp: &str, pfpsf: &mut _IDEC_flags) -> d128

Source

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)

Source

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)

Source

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)

Source

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

Source

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.

Source

pub fn fmod(&self, rhs: &d128, pfpsf: &mut _IDEC_flags) -> Self

Computes the decimal floating point remainder of the division operation x / y.

Source

pub fn frexp(&self) -> (Self, i32)

Decomposes given decimal floating point value num into a normalized fraction and an integral power of two.

Source

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.

Source

pub fn llquantexp(&self, pfpsf: &mut _IDEC_flags) -> i64

The llquantexp() functions return the quantum exponent of x.

Source

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

Source

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.

Source

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.

Source

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

Source

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

Source

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

Source

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.

Source

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

Source

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.

Source

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

Source

pub fn modf(&self, pfpsf: &mut _IDEC_flags) -> (Self, Self)

Decomposes given decimal floating point value num into integral and fractional parts.

Source

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.

Source

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

Source

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

Source

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.

Source

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

Source

pub fn quantexp(&self, pfpsf: &mut _IDEC_flags) -> i32

The quantexp() functions return the quantum exponent of x.

Source

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

Source

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.

Source

pub fn scaleb( &self, n: i32, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self

Returns x * 10^N

Source

pub fn scalebln( &self, n: i64, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self

Returns x * 10^N

Source

pub fn square_root( &self, rnd_mode: Option<RoundingMode>, pfpsf: &mut _IDEC_flags, ) -> Self

Decimal floating-point square root

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn addition( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self

Decimal floating-point addition, d128 + d128 -> d128

Source

pub fn division( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self

Decimal floating-point division, d128 / d128 -> d128

Source

pub fn multiplication( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self

Decimal floating-point multiplication, d128 / d128 -> d128

Source

pub fn remainder(lhs: &Self, rhs: &Self, status: &mut _IDEC_flags) -> Self

Decimal floating-point remainder

Source

pub fn subtraction( lhs: &Self, rhs: &Self, rnd_mode: Option<RoundingMode>, status: &mut _IDEC_flags, ) -> Self

Decimal floating-point subtraction, d128 - d128 -> d128

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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<&d128> for &d128

Source§

type Output = <d128 as Add>::Output

The resulting type after applying the + operator.
Source§

fn add(self, other: &d128) -> <d128 as Add<d128>>::Output

Performs the + operation. Read more
Source§

impl Add<&d128> for d128

Source§

type Output = <d128 as Add>::Output

The resulting type after applying the + operator.
Source§

fn add(self, other: &d128) -> <d128 as Add<d128>>::Output

Performs the + operation. Read more
Source§

impl<'a> Add<d128> for &'a d128

Source§

type Output = <d128 as Add>::Output

The resulting type after applying the + operator.
Source§

fn add(self, other: d128) -> <d128 as Add<d128>>::Output

Performs the + operation. Read more
Source§

impl Add for d128

Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation.

§Examples
let dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
let res  = dec1 + dec2;
Source§

type Output = d128

The resulting type after applying the + operator.
Source§

impl AddAssign<&d128> for d128

Source§

fn add_assign(&mut self, other: &d128)

Performs the += operation. Read more
Source§

impl AddAssign for d128

Source§

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 Clone for d128

Source§

fn clone(&self) -> d128

Returns a duplicate 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 d128

Source§

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

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

impl Default for d128

Source§

fn default() -> Self

Returns the default value of 0.

Source§

impl Display for d128

Source§

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

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

impl Div<&d128> for &d128

Source§

type Output = <d128 as Div>::Output

The resulting type after applying the / operator.
Source§

fn div(self, other: &d128) -> <d128 as Div<d128>>::Output

Performs the / operation. Read more
Source§

impl Div<&d128> for d128

Source§

type Output = <d128 as Div>::Output

The resulting type after applying the / operator.
Source§

fn div(self, other: &d128) -> <d128 as Div<d128>>::Output

Performs the / operation. Read more
Source§

impl<'a> Div<d128> for &'a d128

Source§

type Output = <d128 as Div>::Output

The resulting type after applying the / operator.
Source§

fn div(self, other: d128) -> <d128 as Div<d128>>::Output

Performs the / operation. Read more
Source§

impl Div for d128

Source§

fn div(self, rhs: Self) -> Self::Output

Performs the * operation.

§Examples
let dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
let res  = dec1 / dec2;
Source§

type Output = d128

The resulting type after applying the / operator.
Source§

impl DivAssign<&d128> for d128

Source§

fn div_assign(&mut self, other: &d128)

Performs the /= operation. Read more
Source§

impl DivAssign for d128

Source§

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 From<&str> for d128

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for d128

Source§

fn from(value: f32) -> Self

Converts f32 to decimal128.

§Examples
let value = 1.1f32;
let dec1 = decmathlib_rs::d128::d128::from(value);
Source§

impl From<f64> for d128

Source§

fn from(value: f64) -> Self

Converts f64 to decimal128.

§Examples
let value = 1.1f64;
let dec1 = decmathlib_rs::d128::d128::from(value);
Source§

impl From<i32> for d128

Source§

fn from(value: i32) -> Self

Converts i32 to decimal128.

§Examples
let value = 0;
let dec1 = decmathlib_rs::d128::d128::from(value);
Source§

impl From<i64> for d128

Source§

fn from(value: i64) -> Self

Converts i64 to decimal128.

§Examples
let value = 0;
let dec1 = decmathlib_rs::d128::d128::from(value);
Source§

impl From<u128> for d128

Source§

fn from(value: u128) -> Self

Converts an i128 encoded decimal.

§Examples
let dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
Source§

impl From<u32> for d128

Source§

fn from(value: u32) -> Self

Converts u32 to decimal128.

§Examples
let value = 0;
let dec1 = decmathlib_rs::d128::d128::from(value);
Source§

impl From<u64> for d128

Source§

fn from(value: u64) -> Self

Converts i64 to decimal128.

§Examples
let value = 0;
let dec1 = decmathlib_rs::d128::d128::from(value);
Source§

impl FromStr for d128

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Converts a decimal string value to decimal128.

§Examples
use std::str::FromStr;
let dec1 = decmathlib_rs::d128::d128::from_str("+100000.00000000E6107");
Source§

type Err = u32

The associated error which can be returned from parsing.
Source§

impl Hash for d128

Source§

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)

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 LowerExp for d128

Source§

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

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

impl Mul<&d128> for &d128

Source§

type Output = <d128 as Mul>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, other: &d128) -> <d128 as Mul<d128>>::Output

Performs the * operation. Read more
Source§

impl Mul<&d128> for d128

Source§

type Output = <d128 as Mul>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, other: &d128) -> <d128 as Mul<d128>>::Output

Performs the * operation. Read more
Source§

impl<'a> Mul<d128> for &'a d128

Source§

type Output = <d128 as Mul>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, other: d128) -> <d128 as Mul<d128>>::Output

Performs the * operation. Read more
Source§

impl Mul for d128

Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation.

§Examples
let dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
let res  = dec1 * dec2;
Source§

type Output = d128

The resulting type after applying the * operator.
Source§

impl MulAssign<&d128> for d128

Source§

fn mul_assign(&mut self, other: &d128)

Performs the *= operation. Read more
Source§

impl MulAssign for d128

Source§

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 Neg for &d128

Source§

type Output = <d128 as Neg>::Output

The resulting type after applying the - operator.
Source§

fn neg(self) -> <d128 as Neg>::Output

Performs the unary - operation. Read more
Source§

impl Neg for d128

Source§

fn neg(self) -> Self::Output

Performs the unary - operation

§Examples
use std::ops::Neg;
let dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let neg1 = -dec1;
let neg2 = -&dec1;
Source§

type Output = d128

The resulting type after applying the - operator.
Source§

impl PartialEq for d128

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for d128

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
Source§

fn lt(&self, other: &Self) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
Source§

fn le(&self, other: &Self) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
Source§

fn gt(&self, other: &Self) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
Source§

fn ge(&self, other: &Self) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> Product<&'a d128> for d128

Source§

fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl Product for d128

Source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl Rem<&d128> for &d128

Source§

type Output = <d128 as Rem>::Output

The resulting type after applying the % operator.
Source§

fn rem(self, other: &d128) -> <d128 as Rem<d128>>::Output

Performs the % operation. Read more
Source§

impl Rem<&d128> for d128

Source§

type Output = <d128 as Rem>::Output

The resulting type after applying the % operator.
Source§

fn rem(self, other: &d128) -> <d128 as Rem<d128>>::Output

Performs the % operation. Read more
Source§

impl<'a> Rem<d128> for &'a d128

Source§

type Output = <d128 as Rem>::Output

The resulting type after applying the % operator.
Source§

fn rem(self, other: d128) -> <d128 as Rem<d128>>::Output

Performs the % operation. Read more
Source§

impl Rem for d128

Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the - operation.

§Examples
let dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
let res  = dec1 % dec2;
Source§

type Output = d128

The resulting type after applying the % operator.
Source§

impl RemAssign<&d128> for d128

Source§

fn rem_assign(&mut self, other: &d128)

Performs the %= operation. Read more
Source§

impl RemAssign for d128

Source§

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<&d128> for &d128

Source§

type Output = <d128 as Sub>::Output

The resulting type after applying the - operator.
Source§

fn sub(self, other: &d128) -> <d128 as Sub<d128>>::Output

Performs the - operation. Read more
Source§

impl Sub<&d128> for d128

Source§

type Output = <d128 as Sub>::Output

The resulting type after applying the - operator.
Source§

fn sub(self, other: &d128) -> <d128 as Sub<d128>>::Output

Performs the - operation. Read more
Source§

impl<'a> Sub<d128> for &'a d128

Source§

type Output = <d128 as Sub>::Output

The resulting type after applying the - operator.
Source§

fn sub(self, other: d128) -> <d128 as Sub<d128>>::Output

Performs the - operation. Read more
Source§

impl Sub for d128

Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation.

§Examples
let dec1 = decmathlib_rs::d128::d128::from(0x150a2e0d6728de4e95595bd43d654036u128);
let dec2 = decmathlib_rs::d128::d128::from(0xc47aef17e9919a5569aaaf503275e8f4u128);
let res  = dec1 - dec2;
Source§

type Output = d128

The resulting type after applying the - operator.
Source§

impl SubAssign<&d128> for d128

Source§

fn sub_assign(&mut self, other: &d128)

Performs the -= operation. Read more
Source§

impl SubAssign for d128

Source§

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;
Source§

impl<'a> Sum<&'a d128> for d128

Source§

fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Sum for d128

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl UpperExp for d128

Source§

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

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

impl Copy for d128

Source§

impl Eq for d128

Auto Trait Implementations§

§

impl Freeze for d128

§

impl RefUnwindSafe for d128

§

impl Send for d128

§

impl Sync for d128

§

impl Unpin for d128

§

impl UnwindSafe for d128

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<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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.