C examples for math.h:fmax
function
<cmath> <ctgmath> <math.h>
Returns the larger of its arguments: either x or y. If one of the arguments in a NaN, the other is returned.
long double fmaxl (long double x, long double y); long double fmax (long double x, long double y); double fmax (double x, double y); float fmaxf (float x , float y); float fmax (float x , float y); double fmax (Type1 x , Type2 y);
Parameter | Description |
---|---|
x, y | Values among which the function selects a maximum. |
The maximum numeric value of its arguments.
#include <stdio.h> #include <math.h> /* fmax */ int main ()// w w w . j av a2s.co m { printf ("%f\n", fmax(100.0,1.0)); printf ("%f\n", fmax(-100.0,1.0)); printf ("%f\n", fmax(-1.0,1.0)); printf ("%f\n", fmax(-1.0,-1.0)); printf ("%f\n", fmax(-100.0,-1.0)); return 0; }