fmax


fmax

Determines the greater of two floating-point numbers

 #include <math.h> double fmax ( double x , double y  ); float fmaxf ( float x , float y  ); long double fmaxl ( long double x  , long double y  ); 

The fmax( ) functions return the value of the greater argument.

Example:

 // Let big equal the second-greatest possible double value ... const double big = nextafter( DBL_MAX, 0.0 ); // ... and small the second-least possible double value: const double small = nextafter( DBL_MIN, 0.0 ); double a, b, c; /* ... */ if ( fmin( fmin( a, b ), c ) <= small )   printf( "At least one value is too small.\n" ); if ( fmax( fmax( a, b ), c ) >= big )   printf( "At least one value is too great.\n" ); 

See Also

fabs( ), fmin( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net