Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 fdimd32(_Decimal32 x, _Decimal32 y);
_Decimal64 fdimd64(_Decimal64 x, _Decimal64 y);
_Decimal128 fdimd128(_Decimal128 x, _Decimal128 y);
_Decimal32 fdim(_Decimal32 x, _Decimal32 y); /* C++ only */
_Decimal64 fdim(_Decimal64 x, _Decimal64 y); /* C++ only */
_Decimal128 fdim(_Decimal128 x, _Decimal128 y); /* C++ only */
The fdim functions return the positive difference between x and y.
⁄* CELEBF76
This example illustrates the fdimd32() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal32 x = 56789.70DF, y = 56790.00DF, z;
z = fdimd32(y, x);
printf("The result of fdim32(%Hf, %Hf)\n is %Hf\n", y, x, z);
return 0;
}