BloombergLP::bdldfp::DecimalUtil::fma

Return, using the specified x, y, and z, the value of the expression x * y + z, rounded as one ternary operation according to the current decimal floating point rounding mode.

Synopsis

Declared in <bdldfp_decimalutil.h>

static
Decimal32
fma(
    Decimal32 x,
    Decimal32 y,
    Decimal32 z);

Description

Special value handling: * If x or y are quiet NaN, quiet NaN is returned. * If any argument is signaling NaN, quiet NaN is returned and the value of the macro EDOM is stored into errno. * If x*y is an exact infinity and z is an infinity with the opposite sign, quiet NaN is returned and the value of the macro EDOM is stored into errno. * If x is zero and y is infinite or if x is infinite and y is zero, and z is not a NaN, then quiet NaN is returned and the value of the macro EDOM is stored into errno. * If x is zero and y is infinite or if x is infinite and y is zero, and z is NaN, then quiet NaN is returned.