Compare floating point values, including NaN (Not a Number).
#include <math.h> int isgreater(x, y); int isgreaterequal(x, y); int isless(x, y); int islessequal(x, y); int islessgreater(x, y); int isunordered(x, y);
x
A value of type float, double, or long double.
y
A value of type float, double, or long double.
These macros compare two floating point numbers and return a boolean value. Unlike their expression counterparts, these macros accept the NaN value without raising a floating-point exception.
| Macro | Equivalent to Expression |
|---|---|
| isgreater(x, y) | x > y |
| isgreaterequal(x, y) | x >= y |
| isless(x, y) | x < y |
| islessequal(x, y) | x <= y |
| islessgreater(x, y) | x < y || x > y |
| isunordered(x, y) | isnan(x) || isnan(y) |