fmax, fmaxf, fmaxl, fmaxd32, fmaxd64, and fmaxd128 Subroutines

Purpose

Determines the maximum numeric value of two floating-point numbers.

Syntax

#include <math.h>

double fmax (x, y)
double x;
double y;

float fmaxf (x, y)
float x;
float y;

long double fmaxl (x, y)
long double x;
long double y;

_Decimal32 fmaxd32 (x, y);
_Decimal32 x;
_Decimal32 y;

_Decimal64 fmaxd64 (x, y);
_Decimal64 x;
_Decimal64 y;

_Decimal128 fmaxd128 (x, y);
_Decimal128 x;
_Decimal128 y;

Description

The fmax, fmaxf, fmaxl, fmaxd32, fmaxd64, and fmaxd128 subroutines 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, the fmax, fmaxf, fmaxl, fmaxd32, fmaxd64, and fmaxd128 subroutines choose the numeric value.

Parameters

Item Description
x Specifies the value to be computed.
y Specifies the value to be computed.

Return Values

Upon successful completion, the fmaxl, fmaxf, fmaxl, fmaxd32, fmaxd64, and fmaxd128 subroutines return the maximum numeric value of their arguments.

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

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