[#BloombergLP-bdldfp-DecimalUtil-quantize-02] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::quantize :relfileprefix: ../../../ :mrdocs: Return `value` with the same quantum as `exponent`. == Synopsis Declared in `<bdldfp_decimalutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] quantize( xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] value, xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] exponent); ---- == Description 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`. == Return Value `value` with the same quantum as `exponent` == Parameters [cols="1,4"] |=== | Name| Description | *value* | decimal value to quantize | *exponent* | value whose quantum supplies the desired exponent |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#