2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\" Distributed under GPL
|
|
|
|
.\" 2002-07-27 Walter Harms
|
|
|
|
.\" this was done with the help of the glibc manual
|
|
|
|
.\"
|
|
|
|
.TH ISGREATER 3 2002-07-27 "" "Linux Programmer's Manual"
|
|
|
|
.SH NAME
|
2007-07-10 20:32:09 +00:00
|
|
|
isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered \- macros
|
2004-11-03 13:51:07 +00:00
|
|
|
to test a relation
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <math.h>
|
|
|
|
.sp
|
2007-09-20 16:26:31 +00:00
|
|
|
.B "int isgreater(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2007-09-20 16:26:31 +00:00
|
|
|
.B "int isgreaterequal(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2007-09-20 16:26:31 +00:00
|
|
|
.B "int isless(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2007-09-20 16:26:31 +00:00
|
|
|
.B "int islessequal(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2007-09-20 16:26:31 +00:00
|
|
|
.B "int islessgreater(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2007-09-20 16:26:31 +00:00
|
|
|
.B "int isunordered(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.fi
|
|
|
|
.sp
|
2007-05-21 09:56:00 +00:00
|
|
|
Compile with \fI\-std=c99\fP; link with \fI\-lm\fP.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The normal relation operations (like less) will fail if one of the
|
2007-04-12 22:42:49 +00:00
|
|
|
operands is NaN.
|
|
|
|
This will cause an exception.
|
|
|
|
To avoid this, C99 defines
|
|
|
|
these macros.
|
|
|
|
The macros are guaranteed to evaluate their operands only once.
|
2004-11-03 13:51:07 +00:00
|
|
|
The operand can be of any real floating-point type.
|
|
|
|
.TP
|
|
|
|
isgreater()
|
2007-12-24 15:08:20 +00:00
|
|
|
determines \fI(x)\ >\ (y)\fP without an exception
|
|
|
|
if \fIx\fP or \fIy\fP is NaN.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
isgreaterequal()
|
2007-12-24 15:08:20 +00:00
|
|
|
determines \fI(x)\ >=\ (y)\fP without an exception
|
|
|
|
if \fIx\fP or \fIy\fP is NaN.
|
2007-04-12 22:42:49 +00:00
|
|
|
.TP
|
2004-11-03 13:51:07 +00:00
|
|
|
isless()
|
2007-12-24 15:08:20 +00:00
|
|
|
determines \fI(x)\ <\ (y)\fP without an exception
|
|
|
|
if \fIx\fP or \fIy\fP is NaN.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
islessequal()
|
2007-12-24 15:08:20 +00:00
|
|
|
determines \fI(x)\ <=\ (y)\fP without an exception
|
|
|
|
if \fIx\fP or \fIy\fP is NaN.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
islessgreater()
|
2007-12-24 15:08:20 +00:00
|
|
|
determines \fI(x)\ < (y) || (x) >\ (y)\fP
|
|
|
|
without an exception if \fIx\fP or \fIy\fP is NaN.
|
|
|
|
This macro is not equivalent to \fIx\ !=\ y\fP because that expression is
|
|
|
|
true if \fIx\fP or \fIy\fP is NaN.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
isunordered()
|
2007-12-24 15:08:20 +00:00
|
|
|
is true if \fIx\fP or \fIy\fP is NaN and false otherwise.
|
2007-05-19 04:30:20 +00:00
|
|
|
.SH "CONFORMING TO"
|
|
|
|
C99
|
2007-05-16 02:54:18 +00:00
|
|
|
.SH NOTES
|
2004-11-03 13:51:07 +00:00
|
|
|
Not all hardware supports these functions, and where it doesn't, they
|
2007-04-12 22:42:49 +00:00
|
|
|
will be emulated by macros.
|
|
|
|
This will give you a performance penalty.
|
2004-11-03 13:51:07 +00:00
|
|
|
Don't use these functions if NaN is of no concern for you.
|
|
|
|
.SH "SEE ALSO"
|
2006-12-27 04:17:45 +00:00
|
|
|
.BR fpclassify (3),
|
2004-11-12 16:25:23 +00:00
|
|
|
.BR isnan (3)
|