Determines if its first argument is smaller than or larger than its second.
Include
<math.h>
Prototype
int islessgreater(floating-point x, floating-point
y);
Arguments
x
y
Return Value
Determines if its first argument is smaller than or greater than its second,
as if by the expression (x) < (y) || (x) > (y)
only without any
invalid floating-point exception should the arguments be unordered (i.e. should one of
them be NaN).
Example
#include <math.h>
#include <stdio.h>
int main(void)
{
double x, y;
int b;
x = -5.7;
y = 2.0;
b = islessgreater(x, y);
printf("That %f is less than or greater than %f is %s\n", x, y, b ? "true" : "false");
}
Example Output
That -5.700000 is less than or greater than 2.000000 is true