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