1ISGREATER(3) Linux Programmer's Manual ISGREATER(3)
2
3
4
6 isgreater, isgreaterequal, isless, islessequal, islessgreater,
7 isunordered - floating-point relational tests without exception for NaN
8
10 #include <math.h>
11
12 int isgreater(x, y);
13
14 int isgreaterequal(x, y);
15
16 int isless(x, y);
17
18 int islessequal(x, y);
19
20 int islessgreater(x, y);
21
22 int isunordered(x, y);
23
24 Link with -lm.
25
26 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
27
28 All functions described here:
29 _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE ||
30 _POSIX_C_SOURCE >= 200112L;
31 or cc -std=c99
32
34 The normal relation operations (like <, "less than") will fail if one
35 of the operands is NaN. This will cause an exception. To avoid this,
36 C99 defines the macros listed below.
37
38 These macros are guaranteed to evaluate their arguments only once. The
39 arguments must be of real floating-point type (note: do not pass inte‐
40 ger values as arguments to these macros, since the arguments will not
41 be promoted to real-floating types).
42
43 isgreater()
44 determines (x) > (y) without an exception if x or y is NaN.
45
46 isgreaterequal()
47 determines (x) >= (y) without an exception if x or y is NaN.
48
49 isless()
50 determines (x) < (y) without an exception if x or y is NaN.
51
52 islessequal()
53 determines (x) <= (y) without an exception if x or y is NaN.
54
55 islessgreater()
56 determines (x) < (y) || (x) > (y) without an exception if x or y
57 is NaN. This macro is not equivalent to x != y because that
58 expression is true if x or y is NaN.
59
60 isunordered()
61 determines whether its arguments are unordered, that is, whether
62 at least one of the arguments is a NaN.
63
65 The macros other than isunordered() return the result of the relational
66 comparison; these macros return 0 if either argument is a NaN.
67
68 isunordered() returns 1 if x or y is NaN and 0 otherwise.
69
71 No errors occur.
72
74 C99, POSIX.1-2001.
75
77 Not all hardware supports these functions, and where hardware support
78 isn't provided, they will be emulated by macros. This will result in a
79 performance penalty. Don't use these functions if NaN is of no concern
80 for you.
81
83 fpclassify(3), isnan(3)
84
86 This page is part of release 3.53 of the Linux man-pages project. A
87 description of the project, and information about reporting bugs, can
88 be found at http://www.kernel.org/doc/man-pages/.
89
90
91
92 2012-05-06 ISGREATER(3)