1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
7 .\" 2002-07-27 Walter Harms
8 .\" this was done with the help of the glibc manual
10 .TH ISGREATER 3 2014-01-27 "" "Linux Programmer's Manual"
12 isgreater, isgreaterequal, isless, islessequal, islessgreater,
13 isunordered \- floating-point relational tests without exception for NaN
18 .BI "int isgreater(" x ", " y );
20 .BI "int isgreaterequal(" x ", " y );
22 .BI "int isless(" x ", " y );
24 .BI "int islessequal(" x ", " y );
26 .BI "int islessgreater(" x ", " y );
28 .BI "int isunordered(" x ", " y );
34 Feature Test Macro Requirements for glibc (see
35 .BR feature_test_macros (7)):
39 All functions described here:
41 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
42 _POSIX_C_SOURCE\ >=\ 200112L;
49 The normal relation operations (like
52 will fail if one of the operands is NaN.
53 This will cause an exception.
54 To avoid this, C99 defines the macros listed below.
56 These macros are guaranteed to evaluate their arguments only once.
57 The arguments must be of real floating-point type (note: do not pass
58 integer values as arguments to these macros, since the arguments will
60 be promoted to real-floating types).
63 determines \fI(x)\ >\ (y)\fP without an exception
71 determines \fI(x)\ >=\ (y)\fP without an exception
79 determines \fI(x)\ <\ (y)\fP without an exception
87 determines \fI(x)\ <=\ (y)\fP without an exception
95 determines \fI(x)\ < (y) || (x) >\ (y)\fP
96 without an exception if
101 This macro is not equivalent to \fIx\ !=\ y\fP because that expression is
109 determines whether its arguments are unordered, that is, whether
110 at least one of the arguments is a NaN.
112 The macros other than
114 return the result of the relational comparison;
115 these macros return 0 if either argument is a NaN.
122 is NaN and 0 otherwise.
126 .SS Multithreading (see pthreads(7))
129 .BR isgreaterequal (),
132 .BR islessgreater (),
135 macros are thread-safe.
139 Not all hardware supports these functions,
140 and where hardware support isn't provided, they will be emulated by macros.
141 This will result in a performance penalty.
142 Don't use these functions if NaN is of no concern for you.