]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/isgreater.3
proc.5: Note kernel version for /proc/PID/smaps VmFlags "wf" flag
[thirdparty/man-pages.git] / man3 / isgreater.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .\" 2002-07-27 Walter Harms
8 .\" this was done with the help of the glibc manual
9 .\"
10 .TH ISGREATER 3 2017-09-15 "" "Linux Programmer's Manual"
11 .SH NAME
12 isgreater, isgreaterequal, isless, islessequal, islessgreater,
13 isunordered \- floating-point relational tests without exception for NaN
14 .SH SYNOPSIS
15 .nf
16 .B #include <math.h>
17 .PP
18 .BI "int isgreater(" x ", " y );
19 .PP
20 .BI "int isgreaterequal(" x ", " y );
21 .PP
22 .BI "int isless(" x ", " y );
23 .PP
24 .BI "int islessequal(" x ", " y );
25 .PP
26 .BI "int islessgreater(" x ", " y );
27 .PP
28 .BI "int isunordered(" x ", " y );
29 .fi
30 .PP
31 Link with \fI\-lm\fP.
32 .PP
33 .in -4n
34 Feature Test Macro Requirements for glibc (see
35 .BR feature_test_macros (7)):
36 .in
37 .PP
38 .ad l
39 All functions described here:
40 .RS
41 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
42 .RE
43 .ad b
44 .SH DESCRIPTION
45 The normal relational operations (like
46 .BR < ,
47 "less than")
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.
51 .PP
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
55 .I not
56 be promoted to real-floating types).
57 .TP
58 .BR isgreater ()
59 determines \fI(x)\ >\ (y)\fP without an exception
60 if
61 .IR x
62 or
63 .I y
64 is NaN.
65 .TP
66 .BR isgreaterequal ()
67 determines \fI(x)\ >=\ (y)\fP without an exception
68 if
69 .IR x
70 or
71 .I y
72 is NaN.
73 .TP
74 .BR isless ()
75 determines \fI(x)\ <\ (y)\fP without an exception
76 if
77 .IR x
78 or
79 .I y
80 is NaN.
81 .TP
82 .BR islessequal ()
83 determines \fI(x)\ <=\ (y)\fP without an exception
84 if
85 .IR x
86 or
87 .I y
88 is NaN.
89 .TP
90 .BR islessgreater ()
91 determines \fI(x)\ < (y) || (x) >\ (y)\fP
92 without an exception if
93 .IR x
94 or
95 .I y
96 is NaN.
97 This macro is not equivalent to \fIx\ !=\ y\fP because that expression is
98 true if
99 .IR x
100 or
101 .I y
102 is NaN.
103 .TP
104 .BR isunordered ()
105 determines whether its arguments are unordered, that is, whether
106 at least one of the arguments is a NaN.
107 .SH RETURN VALUE
108 The macros other than
109 .BR isunordered ()
110 return the result of the relational comparison;
111 these macros return 0 if either argument is a NaN.
112 .PP
113 .BR isunordered ()
114 returns 1 if
115 .IR x
116 or
117 .I y
118 is NaN and 0 otherwise.
119 .SH ERRORS
120 No errors occur.
121 .SH ATTRIBUTES
122 For an explanation of the terms used in this section, see
123 .BR attributes (7).
124 .ad l
125 .TS
126 allbox;
127 lbw30 lb lb
128 l l l.
129 Interface Attribute Value
130 T{
131 .BR isgreater (),
132 .BR isgreaterequal (),
133 .BR isless (),
134 .BR islessequal (),
135 .BR islessgreater (),
136 .BR isunordered ()
137 T} Thread safety MT-Safe
138 .TE
139 .ad
140 .SH CONFORMING TO
141 POSIX.1-2001, POSIX.1-2008, C99.
142 .SH NOTES
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.
147 .SH SEE ALSO
148 .BR fpclassify (3),
149 .BR isnan (3)