]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/isgreater.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / isgreater.3
CommitLineData
fea681da 1.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2297bf0e 2.\"
95fb8859 3.\" SPDX-License-Identifier: GPL-1.0-or-later
1714d184 4.\"
fea681da
MK
5.\" 2002-07-27 Walter Harms
6.\" this was done with the help of the glibc manual
7.\"
45186a5d 8.TH ISGREATER 3 2021-03-22 "Linux man-pages (unreleased)"
fea681da 9.SH NAME
2b7f1d12
MK
10isgreater, isgreaterequal, isless, islessequal, islessgreater,
11isunordered \- floating-point relational tests without exception for NaN
2af19291
AC
12.SH LIBRARY
13Math library
8fc3b2cf 14.RI ( libm ", " \-lm )
fea681da
MK
15.SH SYNOPSIS
16.nf
17.B #include <math.h>
68e4db0a 18.PP
2b7f1d12 19.BI "int isgreater(" x ", " y );
2b7f1d12 20.BI "int isgreaterequal(" x ", " y );
2b7f1d12 21.BI "int isless(" x ", " y );
2b7f1d12 22.BI "int islessequal(" x ", " y );
2b7f1d12 23.BI "int islessgreater(" x ", " y );
2b7f1d12 24.BI "int isunordered(" x ", " y );
fea681da 25.fi
68e4db0a 26.PP
d39ad78f 27.RS -4
2b7f1d12
MK
28Feature Test Macro Requirements for glibc (see
29.BR feature_test_macros (7)):
d39ad78f 30.RE
68e4db0a 31.PP
9d2adbae
MK
32.nf
33 All functions described here:
5c10d2c5 34 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
9d2adbae 35.fi
fea681da 36.SH DESCRIPTION
f1b7532b 37The normal relational operations (like
022671eb
MK
38.BR < ,
39"less than")
a23d8efa 40fail if one of the operands is NaN.
c13182ef 41This will cause an exception.
b45a72fb 42To avoid this, C99 defines the macros listed below.
847e0d88 43.PP
b45a72fb
MK
44These macros are guaranteed to evaluate their arguments only once.
45The arguments must be of real floating-point type (note: do not pass
46integer values as arguments to these macros, since the arguments will
47.I not
48be promoted to real-floating types).
fea681da 49.TP
2b7f1d12 50.BR isgreater ()
3f282501 51determines \fI(x)\ >\ (y)\fP without an exception
022671eb 52if
1ae6b2c7 53.I x
022671eb
MK
54or
55.I y
56is NaN.
fea681da 57.TP
2b7f1d12 58.BR isgreaterequal ()
3f282501 59determines \fI(x)\ >=\ (y)\fP without an exception
022671eb 60if
1ae6b2c7 61.I x
022671eb
MK
62or
63.I y
64is NaN.
c13182ef 65.TP
2b7f1d12 66.BR isless ()
3f282501 67determines \fI(x)\ <\ (y)\fP without an exception
022671eb 68if
1ae6b2c7 69.I x
022671eb
MK
70or
71.I y
72is NaN.
fea681da 73.TP
2b7f1d12 74.BR islessequal ()
3f282501 75determines \fI(x)\ <=\ (y)\fP without an exception
022671eb 76if
1ae6b2c7 77.I x
022671eb
MK
78or
79.I y
80is NaN.
fea681da 81.TP
2b7f1d12 82.BR islessgreater ()
3f282501 83determines \fI(x)\ < (y) || (x) >\ (y)\fP
022671eb 84without an exception if
1ae6b2c7 85.I x
022671eb
MK
86or
87.I y
88is NaN.
3f282501 89This macro is not equivalent to \fIx\ !=\ y\fP because that expression is
022671eb 90true if
1ae6b2c7 91.I x
022671eb
MK
92or
93.I y
94is NaN.
fea681da 95.TP
2b7f1d12
MK
96.BR isunordered ()
97determines whether its arguments are unordered, that is, whether
98at least one of the arguments is a NaN.
99.SH RETURN VALUE
100The macros other than
101.BR isunordered ()
102return the result of the relational comparison;
103these macros return 0 if either argument is a NaN.
847e0d88 104.PP
2b7f1d12 105.BR isunordered ()
022671eb 106returns 1 if
1ae6b2c7 107.I x
022671eb
MK
108or
109.I y
110is NaN and 0 otherwise.
2b7f1d12
MK
111.SH ERRORS
112No errors occur.
dd733b11 113.SH ATTRIBUTES
2b9fafa9
MK
114For an explanation of the terms used in this section, see
115.BR attributes (7).
116.ad l
c466875e 117.nh
2b9fafa9
MK
118.TS
119allbox;
c466875e 120lbx lb lb
2b9fafa9
MK
121l l l.
122Interface Attribute Value
123T{
dd733b11
PH
124.BR isgreater (),
125.BR isgreaterequal (),
126.BR isless (),
127.BR islessequal (),
128.BR islessgreater (),
dd733b11 129.BR isunordered ()
2b9fafa9
MK
130T} Thread safety MT-Safe
131.TE
c466875e 132.hy
2b9fafa9 133.ad
c466875e 134.sp 1
3113c7f3 135.SH STANDARDS
e18521f2 136POSIX.1-2001, POSIX.1-2008, C99.
19c98696 137.SH NOTES
2b7f1d12
MK
138Not all hardware supports these functions,
139and where hardware support isn't provided, they will be emulated by macros.
140This will result in a performance penalty.
fea681da 141Don't use these functions if NaN is of no concern for you.
47297adb 142.SH SEE ALSO
358cb5dd 143.BR fpclassify (3),
608e2ed9 144.BR isnan (3)