]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/gen/isgreater.3
unbound: Vendor import 1.19.0
[FreeBSD/FreeBSD.git] / lib / libc / gen / isgreater.3
1 .\" Copyright (c) 2003 David Schultz <das@FreeBSD.org>
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 .Dd February 12, 2003
26 .Dt ISGREATER 3
27 .Os
28 .Sh NAME
29 .Nm isgreater , isgreaterequal , isless , islessequal ,
30 .Nm islessgreater , isunordered
31 .Nd "compare two floating-point numbers"
32 .Sh LIBRARY
33 .Lb libc
34 .Sh SYNOPSIS
35 .In math.h
36 .Ft int
37 .Fn isgreater "real-floating x" "real-floating y"
38 .Ft int
39 .Fn isgreaterequal "real-floating x" "real-floating y"
40 .Ft int
41 .Fn isless "real-floating x" "real-floating y"
42 .Ft int
43 .Fn islessequal "real-floating x" "real-floating y"
44 .Ft int
45 .Fn islessgreater "real-floating x" "real-floating y"
46 .Ft int
47 .Fn isunordered "real-floating x" "real-floating y"
48 .Sh DESCRIPTION
49 Each of the macros
50 .Fn isgreater ,
51 .Fn isgreaterequal ,
52 .Fn isless ,
53 .Fn islessequal ,
54 and
55 .Fn islessgreater
56 take arguments
57 .Fa x
58 and
59 .Fa y
60 and return a non-zero value if and only if its nominal
61 relation on
62 .Fa x
63 and
64 .Fa y
65 is true.
66 These macros always return zero if either
67 argument is not a number (NaN), but unlike the corresponding C
68 operators, they never raise a floating point exception.
69 .Pp
70 The
71 .Fn isunordered
72 macro takes arguments
73 .Fa x
74 and
75 .Fa y
76 and returns non-zero if and only if any of
77 .Fa x
78 or
79 .Fa y
80 are NaNs.
81 For any pair of floating-point values, one
82 of the relationships (less, greater, equal, unordered) holds.
83 .Sh SEE ALSO
84 .Xr fpclassify 3 ,
85 .Xr math 3 ,
86 .Xr signbit 3
87 .Sh STANDARDS
88 The
89 .Fn isgreater ,
90 .Fn isgreaterequal ,
91 .Fn isless ,
92 .Fn islessequal ,
93 .Fn islessgreater ,
94 and
95 .Fn isunordered
96 macros conform to
97 .St -isoC-99 .
98 .Sh HISTORY
99 The relational macros described above first appeared in
100 .Fx 5.1 .