function
<cmath> <ctgmath>
fmindouble fmin (double x , double y); float fminf (float x , float y);long double fminl (long double x, long double y);
double fmin (double x , double y); float fmin (float x , float y);long double fmin (long double x, long double y); double fmin (Type1 x , Type2 y); // additional overloads
Minimum value
Returns the smaller of its arguments: either x or y.If one of the arguments in a NaN, the other is returned.
Header
<tgmath.h>provides a type-generic macro version of this function.
are provided in this header (
<cmath>
) for other combinations of
arithmetic types(
Type1and
Type2): These overloads effectively cast its arguments to
double
before calculations, except if at least one of the arguments is of type
long double
(in which case both are casted to
long double
instead).
1
2
3
4
5
6
7
8
9
10
11
/* fmin example */
#include <stdio.h> /* printf */
#include <math.h> /* fmin */
int main ()
{
printf ("fmin (100.0, 1.0) = %f\n", fmin(100.0,1.0));
printf ("fmin (-100.0, 1.0) = %f\n", fmin(-100.0,1.0));
printf ("fmin (-100.0, -1.0) = %f\n", fmin(-100.0,-1.0));
return 0;
}
fmin (100.0, 1.0) = 1.000000 fmin (-100.0, 1.0) = -100.000000 fmin (-100.0,-1.0) = -100.000000
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4