BloombergLP::bdldfp::DecimalImpUtil

This struct provides a namespace for utility functions that implement core decimal floating-poing operations.

Synopsis

Declared in <bdldfp_decimalimputil.h>

class DecimalImpUtil;

Types

NameDescription
This_is_not_a_floating_point_literal This struct is a helper type used to generate error messages for bad literals.

Type Aliases

NameDescription
ValueType128 128-bit raw decimal storage type.
ValueType32 32-bit raw decimal storage type.
ValueType64 64-bit raw decimal storage type.

Enums

NameDescription
Unnamed enum Status flags for decimal numeric operations.

Static Member Functions

NameDescription
add Return the sum of lhs and rhs.
binaryToDecimal128 Create a Decimal128 closest to binary floating-point value.
binaryToDecimal32 Create a Decimal32 closest to binary floating-point value.
binaryToDecimal64 Create a Decimal64 closest to binary floating-point value.
ceil Return the smallest integral value not less than x.
checkLiteral checkLiteral overloads
classify Return the floating-point classification of x.
convertBIDtoDPD Convert value to Densely Packed Decimal (DPD) format.
convertDPDtoBID Convert Densely Packed Decimal dpd to the implementation type.
convertFromBID Convert Binary Integral Decimal bid to the implementation type.
convertToBID Convert value to Binary Integral Decimal (BID) format.
convertToDecimal128 convertToDecimal128 overloads
convertToDecimal32 Convert input to the closest ValueType32 value.
convertToDecimal64 Convert input to the closest ValueType64 value.
copySign Return a value with the magnitude of x and the sign of y.
decompose Decompose value into sign, significand, and exponent.
denormMin128 Return the smallest positive denormalized value for the ValueType128 type (IEEE-754: +0.000000000000000000000000000000001e-6143).
denormMin32 Return the smallest positive denormalized value for the ValueType32 type (IEEE-754: +0.000001e-95).
denormMin64 Return the smallest positive denormalized value for the ValueType64 type (IEEE-754: +0.000000000000001e-383).
divide Return the quotient of lhs divided by rhs.
epsilon128 Return the difference between the least representable value of type ValueType128 greater than 1 and 1 (IEEE-754: +1e-33).
epsilon32 Return the difference between the least representable value of type ValueType32 greater than 1 and 1 (IEEE-754: +1e-6).
epsilon64 Return the difference between the least representable value of type ValueType64 greater than 1 and 1 (IEEE-754: +1e-15).
equal Return true if lhs and rhs have the same value.
exp Return e raised to the power x.
fabs Return the absolute value of x.
floor Return the largest integral value not greater than x.
fma Return x * y + z, rounded as one ternary operation.
fmod Return the floating-point remainder of x divided by y.
format Format value into buffer using cfg.
greater Return true if lhs is greater than rhs.
greaterEqual Return true if lhs is greater than or equal to rhs.
infinity128 Return the value that represents positive infinity for the ValueType128 type.
infinity32 Return the value that represents positive infinity for the ValueType32 type.
infinity64 Return the value that represents positive infinity for the ValueType64 type.
int32ToDecimal128 Return a Decimal128 representation of value.
int32ToDecimal32 Return a Decimal32 representation of value.
int32ToDecimal64 Return a Decimal64 representation of value.
int64ToDecimal128 Return a Decimal128 representation of value.
int64ToDecimal32 Return a Decimal32 representation of value.
int64ToDecimal64 Return a Decimal64 representation of value.
less Return true if lhs is less than rhs.
lessEqual Return true if lhs is less than or equal to rhs.
llrint Return x rounded to the nearest long long int.
log Return the natural logarithm of x.
log10 Return the common (base-10) logarithm of x.
logB Return the radix-based logarithm of the absolute value of x.
lrint Return x rounded to the nearest long int using the current mode.
lround Return x rounded to the nearest long int.
makeDecimal64 Return a Decimal64 with the given significand and exponent.
makeDecimalRaw128 Create a ValueType128 from significand and exponent.
makeDecimalRaw32 Create a ValueType32 from significand and exponent.
makeDecimalRaw64 Create a ValueType64 from significand and exponent.
makeInfinity64 Return a ValueType64 representing positive or negative infinity.
max128 Return the largest number ValueType128 can represent (IEEE-754: +9.999999999999999999999999999999999e+6144).
max32 Return the largest number ValueType32 can represent (IEEE-754: +9.999999e+96).
max64 Return the largest number ValueType64 can represent (IEEE-754: +9.999999999999999e+384).
min128 Return the smallest positive normalized number ValueType128 can represent (IEEE-754: +1e-6143).
min32 Return the smallest positive normalized number ValueType32 can represent (IEEE-754: +1e-95).
min64 Return the smallest positive normalized number ValueType64 can represent (IEEE-754: +1e-383).
multiply Return the product of lhs and rhs.
negate Return the negation of value.
nextafter Return the next representable value after from toward to.
nexttoward Return the next representable value after from toward to.
normalize Return original with a normalized significand and exponent.
notEqual Return true if lhs and rhs do not have the same value.
parse128 parse128 overloads
parse32 parse32 overloads
parse64 parse64 overloads
pow Return base raised to the power exp.
quantize quantize overloads
quantizeEqual Quantize y to exponent into x when exactly representable.
quietNaN128 Return a value that represents non-signaling NaN for the ValueType128 type.
quietNaN32 Return a value that represents non-signaling NaN for the ValueType32 type.
quietNaN64 Return a value that represents non-signaling NaN for the ValueType64 type.
remainder Return the IEEE remainder of x divided by y.
round round overloads
roundError128 Return the maximum rounding error for the ValueType128 type. The actual value returned depends on the current decimal floating point rounding setting.
roundError32 Return the maximum rounding error for the ValueType32 type. The actual value returned depends on the current decimal floating point rounding setting.
roundError64 Return the maximum rounding error for the ValueType64 type. The actual value returned depends on the current decimal floating point rounding setting.
sameQuantum Return true if x and y have the same quantum exponents.
scaleB Return value multiplied by ten raised to exponent.
signalingNaN128 Return a value that represents signaling NaN for the ValueType128 type.
signalingNaN32 Return a value that represents signaling NaN for the ValueType32 type.
signalingNaN64 Return a value that represents signaling NaN for the ValueType64 type.
sqrt Return the square root of x.
subtract Return the difference of lhs and rhs.
trunc Return x rounded toward zero to an integral value.
uint32ToDecimal128 Return a Decimal128 representation of value.
uint32ToDecimal32 Return a Decimal32 representation of value.
uint32ToDecimal64 Return a Decimal64 representation of value.
uint64ToDecimal128 Return a Decimal128 representation of value.
uint64ToDecimal32 Return a Decimal32 representation of value.
uint64ToDecimal64 Return a Decimal64 representation of value.