Return a double object having the value closest to the value of the specified decimal object following the conversion rules defined by IEEE‐754:
Synopsis
Declared in <bdldfp_decimalconvertutil_inteldfp.h>
static
double
decimalToDouble(Decimal32 decimal);
Description
* If the decimal object is a NaN, return a NaN. * Otherwise if decimal is positive or negative infinity, return infinity of the same sign. * Otherwise if decimal is positive or negative zero, return zero of the same sign. * Otherwise if decimal object has an absolute value that is larger than std::numeric_limits<double>::max(), raise the "overflow" floating‐point exception and return infinity of the same sign as decimal. * Otherwise if decimal has an absolute value that is smaller than std::numeric_limits<double>::min(), raise the "underflow" floating‐point exception and return zero of the same sign as decimal. * Otherwise if decimal has a value that has more significant base‐10 digits than std::numeric_limits<double>::digits10, raise the "inexact" floating‐point exception, round that value according to the binary rounding direction setting of the floating‐point environment, and return the result of that. * Otherwise if decimal has a significand that cannot be exactly represented using binary floating‐point, raise the "inexact" floating‐point exception, roundthat value according to the binary rounding direction setting of the environment, and return the result of that. * Otherwise use the exact value of the other object for the initialization if this object.
Created with MrDocs