fmaxd32(), fmaxd64(), fmaxd128() — Calculate the maximum numeric value

Standards

Standards / Extensions C or C++ Dependencies
C/C++ DFP both z/OS® V1.8

Format

#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 */

General description

The fmax() family of functions determine the maximum numeric value of their arguments. NaN arguments are treated as missing data. If one argument is a NaN and the other numeric, then the numeric value will be chosen.
Notes:
  1. To use IEEE decimal floating-point, the hardware must have the Decimal Floating-Point Facility installed.
  2. These functions work in IEEE decimal floating-point format. See "IEEE Decimal Floating-Point" for more information.

Returned value

If successful, they return the maximum numeric value of their arguments.

Example

/* 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);
}

Related information