[#BloombergLP-bdldfp-DecimalUtil-decompose-03] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalUtil.adoc[DecimalUtil]::decompose :relfileprefix: ../../../ :mrdocs: Decompose `value` into sign, significand, and exponent. == Synopsis Declared in `<bdldfp_decimalutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int decompose( int* sign, unsigned int* significand, int* exponent, xref:BloombergLP/bdldfp/Decimal32.adoc[Decimal32] value); ---- == Description Decompose the specified decimal `value` into the components of the decimal floating‐point format and load the result into the specified `sign`, `significand` and `exponent` such that `value` is equal to `sign * significand * (10 ** exponent)`. The special values infinity and NaNs are decomposed to `sign`, `exponent` and `significand` parts, even though they don't have their normal meaning (except `sign`). That is those specific values cannot be restored using these parts, unlike the finite ones. Return the integer value that represents the floating point classification of the specified `value` as follows: * if `value` is NaN, return FP_NAN; * if `value` is infinity, return `FP_INFINITE`; * if `value` is a subnormal value, return `FP_SUBNORMAL`; * if `value` is a zero value, return `FP_ZERO`; * otherwise return `FP_NORMAL`. Note that a decomposed representation may not be unique, for example 10 can be represented as either `10 * (10 ** 0)` or `1 * (10 ** 1)`. The returned `significand` and `exponent` reflect the encoded representation of `value` (i.e., they reflect the `quantum` of `value`). == Return Value floating‐point classification of `value` == Parameters [cols="1,4"] |=== | Name| Description | *sign* | receives +1 or ‐1 for the sign | *significand* | receives the significand | *exponent* | receives the decimal exponent | *value* | decimal value to decompose |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#