Convert a decimal value to the closest 128‐bit decimal representation.

Synopsis

Declared in <bdldfp_decimalimputil_inteldfp.h>

static
DecimalImpUtil_IntelDfp::ValueType128
convertToDecimal128(ValueType32 const& input);

Description

Convert the specified input to the closest value of indicated result type following the conversion rules:

* 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.

Return Value

closest 128‐bit decimal representation of input

Parameters

Name

Description

input

decimal value to convert

Created with MrDocs