fmax(), fmaxf(), fmaxl() — Calculate the maximum numeric value

Standards

Standards / Extensions C or C++ Dependencies
C99
Single UNIX Specification, Version 3
C++ TR1 C99
both  
z/OS® V1R7

Format

#define _ISOC99_SOURCE
#include <math.h>

double fmax(double x, double y);
float fmaxf(float x, float y);
long double fmaxl(long double x, long double y);
C++ TR1 C99:
#define _TR1_C99
#include <math.h>

float fmax(float x, float y); 
long double fmax(long double x, long double y);

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.
Note: The following table shows the viable formats for these functions. See IEEE binary floating-point for more information about IEEE Binary Floating-Point.
Function Hex IEEE
fmax X X
fmaxf X X
fmaxl X X
Restriction: The fmaxf() function does not support the _FP_MODE_VARIABLE feature test macro.

Returned value

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

Related information