NAME
fmaximum, fmaximumf, fmaximuml, fminimum, fminimumf, fminimuml – floating-point maximum and minimum functions
LIBRARY
Math Library (libm, -lm)
SYNOPSIS
#include <math.h>
double
fmaximum(double x, double y);
float
fmaximumf(float x, float y);
long double
fmaximuml(long double x, long double y);
double
fminimum(double x, double y);
float
fminimumf(float x, float y);
long double
fminimuml(long double x, long double y);
DESCRIPTION
The fmaximum(), fmaximumf(), and fmaximuml() functions return the larger of x and y, and likewise, the fminimum(), fminimumf(), and fminimuml() functions return the smaller of x and y. They treat +0.0 as being larger than -0.0.
Unlike the fmax(3) family of functions, which ignore an , if either argument to fmaximum() or fminimum() is an , then the result is an . These routines do not raise any floating-point exceptions.
SEE ALSO
STANDARDS
The fmaximum(), fmaximumf(), fmaximuml(), fminimum(), fminimumf(), and fminimuml() functions conform to ISO/IEC 9899:2024 (“ISO C23”).
HISTORY
These routines first appeared in FreeBSD 16.0.