Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 fmaxd32(_Decimal32 x, _Decimal32 y);
_Decimal64 fmaxd64(_Decimal64 x, _Decimal64 y);
_Decimal128 fmaxd128(_Decimal128 x, _Decimal128 y);
_Decimal32 fmax(_Decimal32 x, _Decimal32 y); /* C++ only */
_Decimal64 fmax(_Decimal64 x, _Decimal64 y); /* C++ only */
_Decimal128 fmax(_Decimal128 x, _Decimal128 y); /* C++ only */
If successful, they return the maximum numeric value of their arguments.
⁄* CELEBF79
This example illustrates the fmaxd128() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal128 x = 3.5DL, y = 4.0DL, z;
z = fmaxd128(x, y);
printf("The maximum number between %DDf and %DDf is %DDf\n", x, y, z);
}