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