[#BloombergLP-bdldfp-DecimalImpUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::DecimalImpUtil :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for utility functions that implement core decimal floating‐poing operations. == Synopsis Declared in `<bdldfp_decimalimputil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class DecimalImpUtil; ---- == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdldfp/DecimalImpUtil/This_is_not_a_floating_point_literal.adoc[`This_is_not_a_floating_point_literal`] | This `struct` is a helper type used to generate error messages for bad literals. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType128.adoc[`ValueType128`] | 128‐bit raw decimal storage type. | xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[`ValueType32`] | 32‐bit raw decimal storage type. | xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType64.adoc[`ValueType64`] | 64‐bit raw decimal storage type. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdldfp/DecimalImpUtil/_04enum.adoc[`Unnamed enum`] | Status flags for decimal numeric operations. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdldfp/DecimalImpUtil/add-0ee.adoc[`add`] | Return the sum of `lhs` and `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/binaryToDecimal128-02.adoc[`binaryToDecimal128`] | Create a `Decimal128` closest to binary floating‐point `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/binaryToDecimal32-0c.adoc[`binaryToDecimal32`] | Create a `Decimal32` closest to binary floating‐point `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/binaryToDecimal64-09.adoc[`binaryToDecimal64`] | Create a `Decimal64` closest to binary floating‐point `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/ceil-0c.adoc[`ceil`] | Return the smallest integral value not less than `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/checkLiteral-0a.adoc[`checkLiteral`] | `checkLiteral` overloads | xref:BloombergLP/bdldfp/DecimalImpUtil/classify-07.adoc[`classify`] | Return the floating‐point classification of `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/convertBIDtoDPD-08.adoc[`convertBIDtoDPD`] | Convert `value` to Densely Packed Decimal (DPD) format. | xref:BloombergLP/bdldfp/DecimalImpUtil/convertDPDtoBID-08.adoc[`convertDPDtoBID`] | Convert Densely Packed Decimal `dpd` to the implementation type. | xref:BloombergLP/bdldfp/DecimalImpUtil/convertFromBID-0b4.adoc[`convertFromBID`] | Convert Binary Integral Decimal `bid` to the implementation type. | xref:BloombergLP/bdldfp/DecimalImpUtil/convertToBID-0d.adoc[`convertToBID`] | Convert `value` to Binary Integral Decimal (BID) format. | xref:BloombergLP/bdldfp/DecimalImpUtil/convertToDecimal128-0d.adoc[`convertToDecimal128`] | `convertToDecimal128` overloads | xref:BloombergLP/bdldfp/DecimalImpUtil/convertToDecimal32-0a4.adoc[`convertToDecimal32`] | Convert `input` to the closest `ValueType32` value. | xref:BloombergLP/bdldfp/DecimalImpUtil/convertToDecimal64-01.adoc[`convertToDecimal64`] | Convert `input` to the closest `ValueType64` value. | xref:BloombergLP/bdldfp/DecimalImpUtil/copySign-02.adoc[`copySign`] | Return a value with the magnitude of `x` and the sign of `y`. | xref:BloombergLP/bdldfp/DecimalImpUtil/decompose-07.adoc[`decompose`] | Decompose `value` into sign, significand, and exponent. | xref:BloombergLP/bdldfp/DecimalImpUtil/denormMin128.adoc[`denormMin128`] | Return the smallest positive denormalized value for the `ValueType128` type (IEEE‐754: +0.000000000000000000000000000000001e‐6143). | xref:BloombergLP/bdldfp/DecimalImpUtil/denormMin32.adoc[`denormMin32`] | Return the smallest positive denormalized value for the `ValueType32` type (IEEE‐754: +0.000001e‐95). | xref:BloombergLP/bdldfp/DecimalImpUtil/denormMin64.adoc[`denormMin64`] | Return the smallest positive denormalized value for the `ValueType64` type (IEEE‐754: +0.000000000000001e‐383). | xref:BloombergLP/bdldfp/DecimalImpUtil/divide-0c.adoc[`divide`] | Return the quotient of `lhs` divided by `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/epsilon128.adoc[`epsilon128`] | Return the difference between the least representable value of type `ValueType128` greater than 1 and 1 (IEEE‐754: +1e‐33). | xref:BloombergLP/bdldfp/DecimalImpUtil/epsilon32.adoc[`epsilon32`] | Return the difference between the least representable value of type `ValueType32` greater than 1 and 1 (IEEE‐754: +1e‐6). | xref:BloombergLP/bdldfp/DecimalImpUtil/epsilon64.adoc[`epsilon64`] | Return the difference between the least representable value of type `ValueType64` greater than 1 and 1 (IEEE‐754: +1e‐15). | xref:BloombergLP/bdldfp/DecimalImpUtil/equal-0e.adoc[`equal`] | Return `true` if `lhs` and `rhs` have the same value. | xref:BloombergLP/bdldfp/DecimalImpUtil/exp-04.adoc[`exp`] | Return `e` raised to the power `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/fabs-0e.adoc[`fabs`] | Return the absolute value of `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/floor-0c.adoc[`floor`] | Return the largest integral value not greater than `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/fma-0e.adoc[`fma`] | Return `x * y + z`, rounded as one ternary operation. | xref:BloombergLP/bdldfp/DecimalImpUtil/fmod-06.adoc[`fmod`] | Return the floating‐point remainder of `x` divided by `y`. | xref:BloombergLP/bdldfp/DecimalImpUtil/format-0c.adoc[`format`] | Format `value` into `buffer` using `cfg`. | xref:BloombergLP/bdldfp/DecimalImpUtil/greater-0c.adoc[`greater`] | Return `true` if `lhs` is greater than `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/greaterEqual-01.adoc[`greaterEqual`] | Return `true` if `lhs` is greater than or equal to `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/infinity128.adoc[`infinity128`] | Return the value that represents positive infinity for the `ValueType128` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/infinity32.adoc[`infinity32`] | Return the value that represents positive infinity for the `ValueType32` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/infinity64.adoc[`infinity64`] | Return the value that represents positive infinity for the `ValueType64` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/int32ToDecimal128.adoc[`int32ToDecimal128`] | Return a `Decimal128` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/int32ToDecimal32.adoc[`int32ToDecimal32`] | Return a `Decimal32` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/int32ToDecimal64.adoc[`int32ToDecimal64`] | Return a `Decimal64` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/int64ToDecimal128.adoc[`int64ToDecimal128`] | Return a `Decimal128` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/int64ToDecimal32.adoc[`int64ToDecimal32`] | Return a `Decimal32` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/int64ToDecimal64.adoc[`int64ToDecimal64`] | Return a `Decimal64` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/less-05.adoc[`less`] | Return `true` if `lhs` is less than `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/lessEqual-0f.adoc[`lessEqual`] | Return `true` if `lhs` is less than or equal to `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/llrint-085.adoc[`llrint`] | Return `x` rounded to the nearest `long long int`. | xref:BloombergLP/bdldfp/DecimalImpUtil/log-09.adoc[`log`] | Return the natural logarithm of `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/log10-08.adoc[`log10`] | Return the common (base‐10) logarithm of `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/logB-042.adoc[`logB`] | Return the radix‐based logarithm of the absolute value of `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/lrint-0f.adoc[`lrint`] | Return `x` rounded to the nearest `long int` using the current mode. | xref:BloombergLP/bdldfp/DecimalImpUtil/lround-0a.adoc[`lround`] | Return `x` rounded to the nearest `long int`. | xref:BloombergLP/bdldfp/DecimalImpUtil/makeDecimal64-00a.adoc[`makeDecimal64`] | Return a `Decimal64` with the given significand and exponent. | xref:BloombergLP/bdldfp/DecimalImpUtil/makeDecimalRaw128-0c.adoc[`makeDecimalRaw128`] | Create a `ValueType128` from `significand` and `exponent`. | xref:BloombergLP/bdldfp/DecimalImpUtil/makeDecimalRaw32.adoc[`makeDecimalRaw32`] | Create a `ValueType32` from `significand` and `exponent`. | xref:BloombergLP/bdldfp/DecimalImpUtil/makeDecimalRaw64-0b.adoc[`makeDecimalRaw64`] | Create a `ValueType64` from `significand` and `exponent`. | xref:BloombergLP/bdldfp/DecimalImpUtil/makeInfinity64.adoc[`makeInfinity64`] | Return a `ValueType64` representing positive or negative infinity. | xref:BloombergLP/bdldfp/DecimalImpUtil/max128.adoc[`max128`] | Return the largest number `ValueType128` can represent (IEEE‐754: +9.999999999999999999999999999999999e+6144). | xref:BloombergLP/bdldfp/DecimalImpUtil/max32.adoc[`max32`] | Return the largest number `ValueType32` can represent (IEEE‐754: +9.999999e+96). | xref:BloombergLP/bdldfp/DecimalImpUtil/max64.adoc[`max64`] | Return the largest number `ValueType64` can represent (IEEE‐754: +9.999999999999999e+384). | xref:BloombergLP/bdldfp/DecimalImpUtil/min128.adoc[`min128`] | Return the smallest positive normalized number `ValueType128` can represent (IEEE‐754: +1e‐6143). | xref:BloombergLP/bdldfp/DecimalImpUtil/min32.adoc[`min32`] | Return the smallest positive normalized number `ValueType32` can represent (IEEE‐754: +1e‐95). | xref:BloombergLP/bdldfp/DecimalImpUtil/min64.adoc[`min64`] | Return the smallest positive normalized number `ValueType64` can represent (IEEE‐754: +1e‐383). | xref:BloombergLP/bdldfp/DecimalImpUtil/multiply-0d.adoc[`multiply`] | Return the product of `lhs` and `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/negate-04.adoc[`negate`] | Return the negation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/nextafter-00.adoc[`nextafter`] | Return the next representable value after `from` toward `to`. | xref:BloombergLP/bdldfp/DecimalImpUtil/nexttoward-06.adoc[`nexttoward`] | Return the next representable value after `from` toward `to`. | xref:BloombergLP/bdldfp/DecimalImpUtil/normalize-0d.adoc[`normalize`] | Return `original` with a normalized significand and exponent. | xref:BloombergLP/bdldfp/DecimalImpUtil/notEqual-0c.adoc[`notEqual`] | Return `true` if `lhs` and `rhs` do not have the same value. | xref:BloombergLP/bdldfp/DecimalImpUtil/parse128-00.adoc[`parse128`] | `parse128` overloads | xref:BloombergLP/bdldfp/DecimalImpUtil/parse32-05.adoc[`parse32`] | `parse32` overloads | xref:BloombergLP/bdldfp/DecimalImpUtil/parse64-03.adoc[`parse64`] | `parse64` overloads | xref:BloombergLP/bdldfp/DecimalImpUtil/pow-07.adoc[`pow`] | Return `base` raised to the power `exp`. | xref:BloombergLP/bdldfp/DecimalImpUtil/quantize-0e0.adoc[`quantize`] | `quantize` overloads | xref:BloombergLP/bdldfp/DecimalImpUtil/quantizeEqual-05.adoc[`quantizeEqual`] | Quantize `y` to `exponent` into `x` when exactly representable. | xref:BloombergLP/bdldfp/DecimalImpUtil/quietNaN128.adoc[`quietNaN128`] | Return a value that represents non‐signaling NaN for the `ValueType128` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/quietNaN32.adoc[`quietNaN32`] | Return a value that represents non‐signaling NaN for the `ValueType32` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/quietNaN64.adoc[`quietNaN64`] | Return a value that represents non‐signaling NaN for the `ValueType64` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/remainder-04.adoc[`remainder`] | Return the IEEE remainder of `x` divided by `y`. | xref:BloombergLP/bdldfp/DecimalImpUtil/round-0f.adoc[`round`] | `round` overloads | xref:BloombergLP/bdldfp/DecimalImpUtil/roundError128.adoc[`roundError128`] | Return the maximum rounding error for the `ValueType128` type. The actual value returned depends on the current decimal floating point rounding setting. | xref:BloombergLP/bdldfp/DecimalImpUtil/roundError32.adoc[`roundError32`] | Return the maximum rounding error for the `ValueType32` type. The actual value returned depends on the current decimal floating point rounding setting. | xref:BloombergLP/bdldfp/DecimalImpUtil/roundError64.adoc[`roundError64`] | Return the maximum rounding error for the `ValueType64` type. The actual value returned depends on the current decimal floating point rounding setting. | xref:BloombergLP/bdldfp/DecimalImpUtil/sameQuantum-0d7.adoc[`sameQuantum`] | Return `true` if `x` and `y` have the same quantum exponents. | xref:BloombergLP/bdldfp/DecimalImpUtil/scaleB-0a.adoc[`scaleB`] | Return `value` multiplied by ten raised to `exponent`. | xref:BloombergLP/bdldfp/DecimalImpUtil/signalingNaN128.adoc[`signalingNaN128`] | Return a value that represents signaling NaN for the `ValueType128` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/signalingNaN32.adoc[`signalingNaN32`] | Return a value that represents signaling NaN for the `ValueType32` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/signalingNaN64.adoc[`signalingNaN64`] | Return a value that represents signaling NaN for the `ValueType64` type. | xref:BloombergLP/bdldfp/DecimalImpUtil/sqrt-03.adoc[`sqrt`] | Return the square root of `x`. | xref:BloombergLP/bdldfp/DecimalImpUtil/subtract-0e.adoc[`subtract`] | Return the difference of `lhs` and `rhs`. | xref:BloombergLP/bdldfp/DecimalImpUtil/trunc-02.adoc[`trunc`] | Return `x` rounded toward zero to an integral value. | xref:BloombergLP/bdldfp/DecimalImpUtil/uint32ToDecimal128.adoc[`uint32ToDecimal128`] | Return a `Decimal128` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/uint32ToDecimal32.adoc[`uint32ToDecimal32`] | Return a `Decimal32` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/uint32ToDecimal64.adoc[`uint32ToDecimal64`] | Return a `Decimal64` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/uint64ToDecimal128.adoc[`uint64ToDecimal128`] | Return a `Decimal128` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/uint64ToDecimal32.adoc[`uint64ToDecimal32`] | Return a `Decimal32` representation of `value`. | xref:BloombergLP/bdldfp/DecimalImpUtil/uint64ToDecimal64.adoc[`uint64ToDecimal64`] | Return a `Decimal64` representation of `value`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#