title | ms.custom | ms.date | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | apiname | apilocation | apitype | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fmax, fmaxf, fmaxl | Microsoft Docs |
11/04/2016 |
|
article |
|
|
DLLExport |
|
|
|
a773ccf7-495e-4a9a-8c6d-dfb53e341e35 |
11 |
corob-msft |
corob |
ghogen |
Determine the larger of two specified numeric values.
double fmax(
double x,
double y
);
float fmax(
float x,
float y
); //C++ only
long double fmax(
long double x,
long double y
); //C++ only
float fmaxf(
float x,
float y
);
long double fmaxl(
long double x,
long double y
);
[in] x
The first value to compare.
[in] y
The second value to compare.
If successful, returns the larger of x
or y
. The value returned is exact, and does not depend on any form of rounding.
Otherwise, may return one of the following values:
Issue | Return |
---|---|
x = NaN |
y |
y = NaN |
x |
x and y = NaN |
NaN |
This function does not use the errors specified in _matherr.
Because C++ allows overloading, you can call overloads of fmax that take and return float and long double types. In a C program, fmax always takes and returns a double.
Function | C header | C++ header |
---|---|---|
fmax , fmaxf , fmaxl |
<math.h> | <cmath> or <math.h> |
For additional compatibility information, see Compatibility.