Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 fabsd32(_Decimal32 x);
_Decimal64 fabsd64(_Decimal64 x);
_Decimal128 fabsd128(_Decimal128 x);
_Decimal32 fabs(_Decimal32 x); /* C++ only */
_Decimal64 fabs(_Decimal64 x); /* C++ only */
_Decimal128 fabs(_Decimal128 x); /* C++ only */
Returns the absolute value of the decimal floating-point input.
⁄* CELEBF75
This example illustrates the fabsd128() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal128 x, y;
x = -5.6798DL;
y = fabsd128(x);
printf("fabsd128(%DDf) = %DDf\n", x, y);
}