OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / 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  2014-01-27 "" "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 .sp
18 .BI "int isgreater(" x ", " y );
19 .sp
20 .BI "int isgreaterequal(" x ", " y );
21 .sp
22 .BI "int isless(" x ", " y );
23 .sp
24 .BI "int islessequal(" x ", " y );
25 .sp
26 .BI "int islessgreater(" x ", " y );
27 .sp
28 .BI "int isunordered(" x ", " y );
29 .fi
30 .sp
31 Link with \fI\-lm\fP.
32 .sp
33 .in -4n
34 Feature Test Macro Requirements for glibc (see
35 .BR feature_test_macros (7)):
36 .in
37 .sp
38 .ad l
39 All functions described here:
40 .RS
41 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
42 _POSIX_C_SOURCE\ >=\ 200112L;
43 .br
44 or
45 .I cc\ -std=c99
46 .RE
47 .ad b
48 .SH DESCRIPTION
49 The normal relation operations (like
50 .BR < ,
51 "less than")
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.
55
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
59 .I not
60 be promoted to real-floating types).
61 .TP
62 .BR isgreater ()
63 determines \fI(x)\ >\ (y)\fP without an exception
64 if
65 .IR x
66 or
67 .I y
68 is NaN.
69 .TP
70 .BR isgreaterequal ()
71 determines \fI(x)\ >=\ (y)\fP without an exception
72 if
73 .IR x
74 or
75 .I y
76 is NaN.
77 .TP
78 .BR isless ()
79 determines \fI(x)\ <\ (y)\fP without an exception
80 if
81 .IR x
82 or
83 .I y
84 is NaN.
85 .TP
86 .BR islessequal ()
87 determines \fI(x)\ <=\ (y)\fP without an exception
88 if
89 .IR x
90 or
91 .I y
92 is NaN.
93 .TP
94 .BR islessgreater ()
95 determines \fI(x)\ < (y) || (x) >\ (y)\fP
96 without an exception if
97 .IR x
98 or
99 .I y
100 is NaN.
101 This macro is not equivalent to \fIx\ !=\ y\fP because that expression is
102 true if
103 .IR x
104 or
105 .I y
106 is NaN.
107 .TP
108 .BR isunordered ()
109 determines whether its arguments are unordered, that is, whether
110 at least one of the arguments is a NaN.
111 .SH RETURN VALUE
112 The macros other than
113 .BR isunordered ()
114 return the result of the relational comparison;
115 these macros return 0 if either argument is a NaN.
116
117 .BR isunordered ()
118 returns 1 if
119 .IR x
120 or
121 .I y
122 is NaN and 0 otherwise.
123 .SH ERRORS
124 No errors occur.
125 .SH ATTRIBUTES
126 .SS Multithreading (see pthreads(7))
127 The
128 .BR isgreater (),
129 .BR isgreaterequal (),
130 .BR isless (),
131 .BR islessequal (),
132 .BR islessgreater (),
133 and
134 .BR isunordered ()
135 macros are thread-safe.
136 .SH CONFORMING TO
137 C99, POSIX.1-2001.
138 .SH NOTES
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.
143 .SH SEE ALSO
144 .BR fpclassify (3),
145 .BR isnan (3)
146 .SH COLOPHON
147 This page is part of release 3.79 of the Linux
148 .I man-pages
149 project.
150 A description of the project,
151 information about reporting bugs,
152 and the latest version of this page,
153 can be found at
154 \%http://www.kernel.org/doc/man\-pages/.