Go to main content

man pages section 3: Extended Library Functions, Volume 2

Exit Print View

Updated: Thursday, June 13, 2019
 
 

fmax(3M)

Name

fmax, fmaxf, fmaxl - determine maximum numeric value of two floating-point numbers

Synopsis

c99 [ flag... ] file... –lm [ library... ]
#include <math.h>

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

Description

These 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, these functions choose the numeric value.

Return Values

Upon successful completion, these functions return the maximum numeric value of their arguments.

If just one argument is a NaN, the other argument is returned.

If x and y are NaN, a NaN is returned.

Errors

No errors are defined.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
Availability
system/library/math
MT-Level
MT-Safe
Standard

See Also

math.h(3HEAD), fdim(3M), fmin(3M), attributes(7), standards(7)