quantize overloads

Synopses

Declared in <bdldfp_decimalutil.h>

Same as the related overload above for quantize.

static
Decimal128
quantize(
    Decimal128 value,
    Decimal128 exponent);

Same as the overload taking Decimal64.

static
Decimal128
quantize(
    Decimal128 value,
    int exponent);

Return a number equal to the specified value (except for possible rounding) having the exponent equal to the exponent of the specified exponent. Rounding may occur when the exponent is greater than the quantum of value. E.g., quantize(147e‐2_d32, 1e‐1_d32) yields 15e‐1_d32. In the opposite direction, if exponent is sufficiently less than the quantum of value, it may not be possible to construct the requested result, and if so, NaN is returned. E.g., quantize(1234567e0_d32, 1e‐1_d32) returns NaN.

static
Decimal32
quantize(
    Decimal32 value,
    Decimal32 exponent);

Return a number equal to the specified value (except for possible rounding) having the specified exponent. Rounding may occur when exponent is greater than the quantum of value. E.g., quantize(147e‐2_d32, ‐1) yields 15e‐1_d32. In the opposite direction, if exponent is sufficiently less than the quantum of value, it may not be possible to construct the requested result, and if so, NaN is returned. E.g., quantize(1234567e0_d32, ‐1) returns NaN. Behavior is undefined unless the exponent satisfies the following conditions * for Decimal32 type: ‐101 <= exponent <= 90 * for Decimal64 type: ‐398 <= exponent <= 369 * for Decimal128 type: ‐6176 <= exponent <= 6111

static
Decimal32
quantize(
    Decimal32 value,
    int exponent);

Same as the related overload above for quantize.

static
Decimal64
quantize(
    Decimal64 value,
    Decimal64 exponent);

Same as the related overload above for quantize.

static
Decimal64
quantize(
    Decimal64 value,
    int exponent);

Created with MrDocs