this repo has no description
1.\" Copyright (c) 2003 David Schultz <dschultz@uclink.Berkeley.EDU>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" Changes:
26.\" Corrected isunordered entry on Dec 1, 2008 -- stc
27.\"
28.Dd December 1, 2008
29.Dt ISGREATER 3
30.Os
31.Sh NAME
32.Nm isgreater , isgreaterequal , isless , islessequal ,
33.Nm islessgreater , isunordered
34.Nd "compare two floating-point numbers"
35.Sh LIBRARY
36.Lb libc
37.Sh SYNOPSIS
38.In math.h
39.Ft int
40.Fn isgreater "real-floating x" "real-floating y"
41.Ft int
42.Fn isgreaterequal "real-floating x" "real-floating y"
43.Ft int
44.Fn isless "real-floating x" "real-floating y"
45.Ft int
46.Fn islessequal "real-floating x" "real-floating y"
47.Ft int
48.Fn islessgreater "real-floating x" "real-floating y"
49.Ft int
50.Fn isunordered "real-floating x" "real-floating y"
51.Sh DESCRIPTION
52Each of the macros
53.Fn isgreater ,
54.Fn isgreaterequal ,
55.Fn isless ,
56.Fn islessequal ,
57and
58.Fn islessgreater
59takes arguments
60.Fa x
61and
62.Fa y
63and returns a non-zero value if and only if its nominal
64relation on
65.Fa x
66and
67.Fa y
68is true.
69These macros always return zero if either
70argument is not a number (NaN), but unlike the corresponding C
71operators, they never raise a floating point exception.
72.Pp
73The
74.Fn isunordered
75macro takes arguments
76.Fa x
77and
78.Fa y ,
79returning non-zero if either
80.Fa x
81or
82.Fa y
83is NaN.
84For any pair of floating-point values, one
85of the relationships (less, greater, equal, unordered) holds.
86.Sh SEE ALSO
87.Xr fpclassify 3 ,
88.Xr math 3 ,
89.Xr signbit 3
90.Sh STANDARDS
91The
92.Fn isgreater ,
93.Fn isgreaterequal ,
94.Fn isless ,
95.Fn islessequal ,
96.Fn islessgreater ,
97and
98.Fn isunordered
99macros conform to
100.St -isoC-99 .