Important: The information in this document is obsolete and should not be used for new development.
fmin
You can use thefmin
function to determine which is the smaller of two real numbers.
double_t fmin (double_t x, double_t y);
x
- Any floating-point number.
y
- Any floating-point number.
DESCRIPTION
Thefmin
function determines the lesser of its two arguments.if x y
if y < xIf one of the arguments is a NaN, the other argument is returned.
EXCEPTIONS
When x and y are finite and nonzero, the result of is exact.SPECIAL CASES
Table 10-3 shows the results when one of the arguments to thefmin
function is a zero, a NaN, or an Infinity. In this table, x is a finite, nonzero floating-point number. (Note that the order of operands for this function does not matter.)
Special cases for the fmin
functionOperation Result Exceptions raised x if x < 0 None +0 if x > 0 x if x < 0 None +0 if x > 0 +0 None x[23] None[24] x None None EXAMPLES
z = fmin(-INFINITY, -300,000); /* z = -INFINITY because is smaller than any integer. */ z = fmin(NAN, -300,000); /* z = -300,000 by definition of the function fmin. */
[23] If both arguments are NaNs, the first NaN is returned.
[24] If the NaN is a signaling NaN, the invalid exception is raised.