In C, fmaximum() returns the maximum of two floating-point values. fmaximum(3.0, 7.0) is 7.0. It is a C23 / newer library API.
You pass two double values. The result is a double. Include <math.h>. On GCC, link with -lm and enable a C23 mode when needed.
Syntax
Pass both values. Start with this call.
C
fmaximum(3.0, 7.0);
Call
What it does
fmaximum(3.0, 7.0)
Returns 7.0, the maximum.
fmaximum(-1.0, -4.0)
Returns -1.0, the larger (less negative) value.
Include <math.h>. On GCC, link with -lm. The C identifier is fmaximum (underscore spelling only if you use related forms like fmaximum_mag). This page URL uses the slug fmaximum.
Library declarations
C
double fmaximum(double x, double y);
float fmaximumf(float x, float y);
long double fmaximuml(long double x, long double y);
Parameters
Parameter
Description
x
Required. First value to compare.
y
Required. Second value to compare.
Return Value
Return Value
Description
double
The maximum of x and y. If either argument is NaN, the result is NaN.