BloombergLP::bdldfp::DecimalUtil::quantizeEqual

quantizeEqual overloads

Synopses

Declared in <bdldfp_decimalutil.h>

Same as the related overload above for quantizeEqual.

static
int
quantizeEqual(
    Decimal128* x,
    Decimal128 y,
    int exponent);
» more...

Set x to y with the specified exponent if that value is exact.

static
int
quantizeEqual(
    Decimal32* x,
    Decimal32 y,
    int exponent);
» more...

Same as the overload taking Decimal32.

static
int
quantizeEqual(
    Decimal64* x,
    Decimal64 y,
    int exponent);
» more...

Return Value

0 on success and a non-zero value otherwise

Parameters

NameDescription
xreceives the quantized value on success
yvalue to quantize into x
exponentdesired decimal exponent