fmax(), fmaxf(), fmaxl()

Determine the maximum of two floating-point numbers

Synopsis:

#include <math.h>

double fmax( double x,
             double y );

float fmaxf( float x,
             float y );

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

Arguments:

x, y
The numbers that you want to compare.

Library:

libm

Use the -l m option to qcc to link against this library.

Description:

The fmax(), fmaxf(), and fmaxl() functions determine the maximum of two floating-point numbers.

To check for error situations, use feclearexcept() and fetestexcept(). For example:

Returns:

The maximum of the arguments.

If: These functions return: Errors:
x and y are both NaN NaN
Just one of the arguments is NaN The numeric value

These functions raise FE_INEXACT if the FPU reports that the result can't be exactly represented as a floating-point number.

Classification:

ANSI, POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes