isgreater(), isgreaterequal(), isless(), islessequal(), islessgreater(), isunordered()

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);   
Parameter

x

A value of type float, double, or long double.

y

A value of type float, double, or long double.

Remarks

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.

NaN is not in the range of floating point values from negative infinity to positive infinity, so it cannot be put in any order when compared to other values. In other words, A NaN value is not greater than, less than, or equal to any other floating point value.
Table 1. Counterparts
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)