]> git.saurik.com Git - apple/libc.git/blame - gen/isgreater.3
Libc-498.1.7.tar.gz
[apple/libc.git] / gen / isgreater.3
CommitLineData
224c7076 1.\" Copyright (c) 2003 David Schultz <dschultz@uclink.Berkeley.EDU>
59e0d9fe
A
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.\"
224c7076 25.\" $FreeBSD: src/lib/libc/gen/isgreater.3,v 1.2 2003/06/01 19:19:59 ru Exp $
59e0d9fe 26.\"
224c7076
A
27.Dd February 12, 2003
28.Dt ISGREATER 3
59e0d9fe
A
29.Os
30.Sh NAME
224c7076
A
31.Nm isgreater , isgreaterequal , isless , islessequal ,
32.Nm islessgreater , isunordered
33.Nd "compare two floating-point numbers"
59e0d9fe 34.Sh LIBRARY
224c7076 35.Lb libc
59e0d9fe
A
36.Sh SYNOPSIS
37.In math.h
38.Ft int
224c7076 39.Fn isgreater "real-floating x" "real-floating y"
59e0d9fe 40.Ft int
224c7076 41.Fn isgreaterequal "real-floating x" "real-floating y"
59e0d9fe 42.Ft int
224c7076 43.Fn isless "real-floating x" "real-floating y"
59e0d9fe 44.Ft int
224c7076 45.Fn islessequal "real-floating x" "real-floating y"
59e0d9fe 46.Ft int
224c7076
A
47.Fn islessgreater "real-floating x" "real-floating y"
48.Ft int
49.Fn isunordered "real-floating x" "real-floating y"
59e0d9fe 50.Sh DESCRIPTION
224c7076
A
51Each of the macros
52.Fn isgreater ,
53.Fn isgreaterequal ,
54.Fn isless ,
55.Fn islessequal ,
56and
57.Fn islessgreater
58takes arguments
59e0d9fe 59.Fa x
224c7076
A
60and
61.Fa y
62and returns a non-zero value if and only if its nominal
63relation on
59e0d9fe 64.Fa x
224c7076
A
65and
66.Fa y
67is true.
68These macros always return zero if either
69argument is not a number (NaN), but unlike the corresponding C
70operators, they never raise a floating point exception.
59e0d9fe
A
71.Pp
72The
224c7076
A
73.Fn isunordered
74macro takes arguments
75.Fa x
59e0d9fe 76and
224c7076
A
77.Fa y ,
78returning non-zero if and only if neither
59e0d9fe 79.Fa x
224c7076
A
80nor
81.Fa y
82are NaNs.
83For any pair of floating-point values, one
84of the relationships (less, greater, equal, unordered) holds.
59e0d9fe 85.Sh SEE ALSO
224c7076 86.Xr fpclassify 3 ,
59e0d9fe
A
87.Xr math 3 ,
88.Xr signbit 3
89.Sh STANDARDS
90The
224c7076
A
91.Fn isgreater ,
92.Fn isgreaterequal ,
93.Fn isless ,
94.Fn islessequal ,
95.Fn islessgreater ,
59e0d9fe 96and
224c7076 97.Fn isunordered
59e0d9fe
A
98macros conform to
99.St -isoC-99 .