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 2017-09-15 "" "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 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
45 The normal relational operations (like
48 fail if one of the operands is NaN.
49 This will cause an exception.
50 To avoid this, C99 defines the macros listed below.
52 These macros are guaranteed to evaluate their arguments only once.
53 The arguments must be of real floating-point type (note: do not pass
54 integer values as arguments to these macros, since the arguments will
56 be promoted to real-floating types).
59 determines \fI(x)\ >\ (y)\fP without an exception
67 determines \fI(x)\ >=\ (y)\fP without an exception
75 determines \fI(x)\ <\ (y)\fP without an exception
83 determines \fI(x)\ <=\ (y)\fP without an exception
91 determines \fI(x)\ < (y) || (x) >\ (y)\fP
92 without an exception if
97 This macro is not equivalent to \fIx\ !=\ y\fP because that expression is
105 determines whether its arguments are unordered, that is, whether
106 at least one of the arguments is a NaN.
108 The macros other than
110 return the result of the relational comparison;
111 these macros return 0 if either argument is a NaN.
118 is NaN and 0 otherwise.
122 For an explanation of the terms used in this section, see
129 Interface Attribute Value
132 .BR isgreaterequal (),
135 .BR islessgreater (),
137 T} Thread safety MT-Safe
141 POSIX.1-2001, POSIX.1-2008, C99.
143 Not all hardware supports these functions,
144 and where hardware support isn't provided, they will be emulated by macros.
145 This will result in a performance penalty.
146 Don't use these functions if NaN is of no concern for you.