1*7161d089Sdrochner.\" $NetBSD: isgreater.3,v 1.1 2007/02/22 22:08:20 drochner Exp $ 2*7161d089Sdrochner.\" 3*7161d089Sdrochner.\" Copyright (c) 2003 David Schultz <das@FreeBSD.ORG> 4*7161d089Sdrochner.\" All rights reserved. 5*7161d089Sdrochner.\" 6*7161d089Sdrochner.\" Redistribution and use in source and binary forms, with or without 7*7161d089Sdrochner.\" modification, are permitted provided that the following conditions 8*7161d089Sdrochner.\" are met: 9*7161d089Sdrochner.\" 1. Redistributions of source code must retain the above copyright 10*7161d089Sdrochner.\" notice, this list of conditions and the following disclaimer. 11*7161d089Sdrochner.\" 2. Redistributions in binary form must reproduce the above copyright 12*7161d089Sdrochner.\" notice, this list of conditions and the following disclaimer in the 13*7161d089Sdrochner.\" documentation and/or other materials provided with the distribution. 14*7161d089Sdrochner.\" 15*7161d089Sdrochner.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16*7161d089Sdrochner.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17*7161d089Sdrochner.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18*7161d089Sdrochner.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19*7161d089Sdrochner.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20*7161d089Sdrochner.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21*7161d089Sdrochner.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22*7161d089Sdrochner.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23*7161d089Sdrochner.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24*7161d089Sdrochner.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25*7161d089Sdrochner.\" SUCH DAMAGE. 26*7161d089Sdrochner.\" 27*7161d089Sdrochner.\" FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/isgreater.3,v 1.3 2005/02/06 03:23:31 das Exp 28*7161d089Sdrochner.\" 29*7161d089Sdrochner.Dd February 12, 2003 30*7161d089Sdrochner.Dt ISGREATER 3 31*7161d089Sdrochner.Os 32*7161d089Sdrochner.Sh NAME 33*7161d089Sdrochner.Nm isgreater , isgreaterequal , isless , islessequal , 34*7161d089Sdrochner.Nm islessgreater , isunordered 35*7161d089Sdrochner.Nd "compare two floating-point numbers" 36*7161d089Sdrochner.Sh LIBRARY 37*7161d089Sdrochner.Lb libc 38*7161d089Sdrochner.Sh SYNOPSIS 39*7161d089Sdrochner.In math.h 40*7161d089Sdrochner.Ft int 41*7161d089Sdrochner.Fn isgreater "real-floating x" "real-floating y" 42*7161d089Sdrochner.Ft int 43*7161d089Sdrochner.Fn isgreaterequal "real-floating x" "real-floating y" 44*7161d089Sdrochner.Ft int 45*7161d089Sdrochner.Fn isless "real-floating x" "real-floating y" 46*7161d089Sdrochner.Ft int 47*7161d089Sdrochner.Fn islessequal "real-floating x" "real-floating y" 48*7161d089Sdrochner.Ft int 49*7161d089Sdrochner.Fn islessgreater "real-floating x" "real-floating y" 50*7161d089Sdrochner.Ft int 51*7161d089Sdrochner.Fn isunordered "real-floating x" "real-floating y" 52*7161d089Sdrochner.Sh DESCRIPTION 53*7161d089SdrochnerEach of the macros 54*7161d089Sdrochner.Fn isgreater , 55*7161d089Sdrochner.Fn isgreaterequal , 56*7161d089Sdrochner.Fn isless , 57*7161d089Sdrochner.Fn islessequal , 58*7161d089Sdrochnerand 59*7161d089Sdrochner.Fn islessgreater 60*7161d089Sdrochnertake arguments 61*7161d089Sdrochner.Fa x 62*7161d089Sdrochnerand 63*7161d089Sdrochner.Fa y 64*7161d089Sdrochnerand return a non-zero value if and only if its nominal 65*7161d089Sdrochnerrelation on 66*7161d089Sdrochner.Fa x 67*7161d089Sdrochnerand 68*7161d089Sdrochner.Fa y 69*7161d089Sdrochneris true. 70*7161d089SdrochnerThese macros always return zero if either 71*7161d089Sdrochnerargument is not a number (NaN), but unlike the corresponding C 72*7161d089Sdrochneroperators, they never raise a floating point exception. 73*7161d089Sdrochner.Pp 74*7161d089SdrochnerThe 75*7161d089Sdrochner.Fn isunordered 76*7161d089Sdrochnermacro takes arguments 77*7161d089Sdrochner.Fa x 78*7161d089Sdrochnerand 79*7161d089Sdrochner.Fa y 80*7161d089Sdrochnerand returns non-zero if and only if neither 81*7161d089Sdrochner.Fa x 82*7161d089Sdrochnernor 83*7161d089Sdrochner.Fa y 84*7161d089Sdrochnerare NaNs. 85*7161d089SdrochnerFor any pair of floating-point values, one 86*7161d089Sdrochnerof the relationships (less, greater, equal, unordered) holds. 87*7161d089Sdrochner.Sh SEE ALSO 88*7161d089Sdrochner.Xr fpclassify 3 , 89*7161d089Sdrochner.Xr math 3 , 90*7161d089Sdrochner.Xr signbit 3 91*7161d089Sdrochner.Sh STANDARDS 92*7161d089SdrochnerThe 93*7161d089Sdrochner.Fn isgreater , 94*7161d089Sdrochner.Fn isgreaterequal , 95*7161d089Sdrochner.Fn isless , 96*7161d089Sdrochner.Fn islessequal , 97*7161d089Sdrochner.Fn islessgreater , 98*7161d089Sdrochnerand 99*7161d089Sdrochner.Fn isunordered 100*7161d089Sdrochnermacros conform to 101*7161d089Sdrochner.St -isoC-99 . 102*7161d089Sdrochner.Sh HISTORY 103*7161d089SdrochnerThe relational macros described above first appeared in 104*7161d089Sdrochner.Nx 5.0 . 105