|
|
|
Defined in header <math.h> | ||
#define islessgreater(x, y) /* implementation defined */ | (since C99) | |
Determines if the floating-point numberx is less than or greater than the floating-point numbery, without setting floating-point exceptions.
Contents |
x | - | floating-point value |
y | - | floating-point value |
Nonzero integral value ifx< y|| x> y,0 otherwise.
The built-inoperator< andoperator> for floating-point numbers may raiseFE_INVALID if one or both of the arguments is NaN. This function is a "quiet" version of the expressionx< y|| x> y. The macro does not evaluate x and y twice.
#include <math.h>#include <stdio.h> int main(void){printf("islessgreater(2.0,1.0) = %d\n", islessgreater(2.0,1.0));printf("islessgreater(1.0,2.0) = %d\n", islessgreater(1.0,2.0));printf("islessgreater(1.0,1.0) = %d\n", islessgreater(1.0,1.0));printf("islessgreater(INFINITY,1.0) = %d\n", islessgreater(INFINITY,1.0));printf("islessgreater(1.0,NAN) = %d\n", islessgreater(1.0, NAN)); return0;}
Possible output:
islessgreater(2.0,1.0) = 1islessgreater(1.0,2.0) = 1islessgreater(1.0,1.0) = 0islessgreater(INFINITY,1.0) = 1islessgreater(1.0,NAN) = 0
(C99) | checks if the first floating-point argument is less than the second (function macro)[edit] |
(C99) | checks if the first floating-point argument is greater than the second (function macro)[edit] |
C++ documentation forislessgreater |