fmad64.3m (2010 09)

f
fmad64(3M) fmad64(3M)
(HP Integrity Server Only)
NAME
fmad64(), fmad128(), fmad32() - decimal floating multiply-add functions
SYNOPSIS
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal64 fmad64(_Decimal64 x, _Decimal64 y, _Decimal64 z);
_Decimal128 fmad128(_Decimal128 x, _Decimal128 y, _Decimal128 z);
_Decimal32 fmad32(_Decimal32 x, _Decimal32 y, _Decimal32 z);
DESCRIPTION
The fmad64() function returns (x*y)+z, rounded as one ternary operation: it computes the value (as
if) to infinite precision and rounds once to the result format, according to the current (decimal) rounding
mode.
fmad128() is a _Decimal128 version of fmad64()
; it takes _Decimal128 arguments and returns
a
_Decimal128 result.
fmad32() is a _Decimal32 version of fmad64()
; it takes _Decimal32 arguments and returns a
_Decimal32 result.
These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward.
USAGE
To use any of these functions, compile with the +decfp option.
Make sure your program defines
__STDC_WANT_DEC_FP__
and then includes <math.h>.
Link in the math library by specifying
-lm or -l:libm.a on the linking command line.
For more information, see the HP-UX floating-point guide for HP Integrity servers at the following site:
http://www.hp.com/go/fp
.
RETURN VALUE
If x, y,orz is NaN,
fmad64() returns NaN.
If one of x and y is infinite, the other is zero, and z is not NaN,
fmad64() returns NaN and raises the
invalid exception.
If x times y is an exact infinity and z is also an infinity but with the opposite sign,
fmad64() returns
NaN and raises the invalid exception.
fmad64() returns the properly signed infinity (or, in some non-default rounding direction modes, the
properly signed maximum-magnitude finite number) in lieu of a value whose magnitude is too large, and
raises the overflow and inexact exceptions.
fmad64() raises the underflow exception whenever a result is tiny (essentially subnormal or zero) and
inexact.
fmad64() raises the inexact exception whenever a rounded result does not equal the mathematical
result.
ERRORS
If one of x and y is infinite, the other is zero, and z is not NaN,
fmad64() sets errno to [EDOM].
If x times y is an exact infinity and z is also an infinity but with the opposite sign,
fmad64() sets
errno to [EDOM].
If the correct value would overflow,
fmad64() sets errno to [ERANGE].
SEE ALSO
math(5).
STANDARDS CONFORMANCE
These functions conform to ISO/IEC TR 24732, "Extension for the programming language C to support
decimal floating-point arithmetic".
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)