[#BloombergLP-bdldfp-DecimalImpUtil_IntelDfp-convertToDecimal128-06] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp.adoc[DecimalImpUtil_IntelDfp]::convertToDecimal128 :relfileprefix: ../../../ :mrdocs: Convert the specified `input` to the closest value of indicated result type following the conversion rules: == Synopsis Declared in `<bdldfp_decimalimputil_inteldfp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp/ValueType128.adoc[DecimalImpUtil_IntelDfp::ValueType128] convertToDecimal128(xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp/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 indicated result type then return the `input` rounded according to the rounding direction. * Otherwise return `input` value of the result type. [.small]#Created with https://www.mrdocs.com[MrDocs]#