1

Can someone advice what is the difference between isgreater(x,y) and > or isless(x,y) and <. My understanding is isless and similar function raise exception (C++). Which is recommended to use?

#define isgreater(x,y) \
          (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
                           !isunordered(__x,__y) && (__x > __y);}))
#define isless(x,y) \
          (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
                           !isunordered(__x,__y) && (__x < __y);}))
Dark Sorrow
  • 1,681
  • 14
  • 37
  • 2
    The [docs](https://linux.die.net/man/3/isunordered) are pretty clear about it, – Eugene Sh. Dec 18 '19 at 16:50
  • also https://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Other-Builtins.html "GCC provides built-in versions of the ISO C99 floating point comparison macros that avoid raising exceptions for unordered operands. They have the same names as the standard macros ( isgreater, isgreaterequal, isless, islessequal, islessgreater, and isunordered) , with __builtin_ prefixed. We intend for a library implementor to be able to simply #define each standard macro to its built-in equivalent." That's not exactly about this, but the behaviour is equivalent. – Sopel Dec 18 '19 at 16:51

0 Answers0