Skip to content

Latest commit

 

History

History
88 lines (70 loc) · 2.33 KB

fmax-fmaxf-fmaxl.md

File metadata and controls

88 lines (70 loc) · 2.33 KB
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
cpp
devlang-cpp
article
fmax
fmaxf
fmaxl
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-math-l1-1-0.dll
DLLExport
fmax
fmaxf
fmaxl
math/fmax
math/fmaxf
math/fmaxl
C++
fmax function
fmaxf function
fmaxl function
a773ccf7-495e-4a9a-8c6d-dfb53e341e35
11
corob-msft
corob
ghogen

fmax, fmaxf, fmaxl

Determine the larger of two specified numeric values.

Syntax

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  
);  
  

Parameters

[in] x
The first value to compare.

[in] y
The second value to compare.

Return Value

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.

Remarks

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.

Requirements

Function C header C++ header
fmax, fmaxf, fmaxl <math.h> <cmath> or <math.h>

For additional compatibility information, see Compatibility.

See Also

Alphabetical Function Reference
fmin, fminf, fminl