[#BloombergLP-bdldfp-DecimalImpUtil-decompose-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil.adoc[DecimalImpUtil]::decompose
:relfileprefix: ../../../
:mrdocs:

Decompose the specified decimal `value` into the components of the decimal floating&hyphen;point format and load the result into the specified `sign`, `significand` and `exponent` such that `value` is equal to `sign &ast; significand &ast; (10 &ast;&ast; exponent)`&period; The special values infinity and NaNs are decomposed to `sign`, `exponent` and `significand` parts, even though they don&apos;t have their normal meaning (except `sign`)&period; That is those specific values cannot be restored using these parts, unlike the finite ones&period; Return the integer value that represents the floating point classification of the specified `value` as follows&colon;

== Synopsis

Declared in `&lt;bdldfp&lowbar;decimalimputil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
decompose(
    int* sign,
    unsigned int* significand,
    int* exponent,
    xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] value);
----

== Description

&ast; if `value` is NaN, return FP&lowbar;NAN&semi; &ast; if `value` is infinity, return `FP&lowbar;INFINITE`&semi; &ast; if `value` is a subnormal value, return `FP&lowbar;SUBNORMAL`&semi; &ast; if `value` is a zero value, return `FP&lowbar;ZERO`&semi; &ast; otherwise return `FP&lowbar;NORMAL`&period;

Note that a decomposed representation may not be unique, for example 10 can be represented as either `10 &ast; (10 &ast;&ast; 0)` or `1 &ast; (10 &ast;&ast; 1)`&period; The returned `significand` and `exponent` reflect the encoded representation of `value` (i&period;e&period;, they reflect the `quantum` of `value`)&period; Decompose the specified decimal `value` into sign, exponent, and coefficient&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
