標準/拡張機能 | C/C++ | 依存項目 |
---|---|---|
C/C++ DFP | 両方 | 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 */
正常に実行された場合は、引数の最大数値を戻します。
⁄* 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);
}