[#BloombergLP-bdldfp-DecimalImpUtil_IntelDfp-convertToDecimal128-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp.adoc[DecimalImpUtil&lowbar;IntelDfp]::convertToDecimal128
:relfileprefix: ../../../
:mrdocs:

Convert the specified `input` to the closest value of indicated result type following the conversion rules&colon;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp/ValueType128.adoc[DecimalImpUtil&lowbar;IntelDfp::ValueType128]
convertToDecimal128(xref:BloombergLP/bdldfp/DecimalImpUtil_IntelDfp/ValueType32.adoc[ValueType32] const& input);
----

== Description

&ast; If `input` is signaling NaN, store the value of the macro `EDOM` into `errno` and return signaling NaN value&period; &ast; If `input` is NaN, return NaN value&period; &ast; Otherwise if `input` is infinity (positive or negative), then return infinity with the same sign&period; &ast; Otherwise if `input` is zero (positive or negative), then return zero with the same sign&period; &ast; 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&period; &ast; 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&period; &ast; Otherwise return `input` value of the result type&period;


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