[#BloombergLP-bdldfp-DecimalImpUtil-convertToDecimal128-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil.adoc[DecimalImpUtil]::convertToDecimal128 :relfileprefix: ../../../ :mrdocs: Convert the specified `input` to the closest value of the indicated result type following the conversion rules as defined by IEEE‐754: == Synopsis Declared in `<bdldfp_decimalimputil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType128.adoc[DecimalImpUtil::ValueType128] convertToDecimal128(xref:BloombergLP/bdldfp/DecimalImpUtil/ValueType32.adoc[ValueType32] const& input); ---- == Description * If `input` is signaling NaN, store the value of the macro `EDOM` into `errno` and return signaling NaN value. * If `input` is NaN, return NaN value. * Otherwise if `input` is infinity (positive or negative), then return infinity with the same sign. * Otherwise if `input` is zero (positive or negative), then return zero with the same sign. * Otherwise if `input` has an absolute value that is larger than maximum or is smaller than minimum value supported by the result type, store the value of the macro `ERANGE` into `errno` and return infinity or zero with the same sign respectively. * Otherwise if `input` has a value that is not exactly representable using maximum digit number supported by the indicated result type then return the `input` rounded according to the rounding direction. * Otherwise return `input` value of the result type. Convert the specified 32‐bit decimal `input` to 128‐bit decimal. [.small]#Created with https://www.mrdocs.com[MrDocs]#