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
|
|
|
|
isgreater, isgreaterequal, isless, islessgreater, isunordered \- macros
|
|
|
|
to test a relation
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <math.h>
|
|
|
|
.sp
|
2006-05-31 22:16:55 +00:00
|
|
|
.BI "int isgreater(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-05-31 22:16:55 +00:00
|
|
|
.BI "int isgreaterequal(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-05-31 22:16:55 +00:00
|
|
|
.BI "int isless(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-05-31 22:16:55 +00:00
|
|
|
.BI "int islessequal(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-05-31 22:16:55 +00:00
|
|
|
.BI "int islessgreater(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-05-31 22:16:55 +00:00
|
|
|
.BI "int isunordered(x,y);"
|
2004-11-03 13:51:07 +00:00
|
|
|
.fi
|
|
|
|
.sp
|
2005-07-06 07:41:37 +00:00
|
|
|
Compile with \-std=c99; link with \-lm.
|
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()
|
|
|
|
determines (x) > (y) without an exception if x or y is NaN.
|
|
|
|
.TP
|
|
|
|
isgreaterequal()
|
|
|
|
determines (x) >= (y) without an exception if x or y is NaN.
|
2007-04-12 22:42:49 +00:00
|
|
|
.TP
|
2004-11-03 13:51:07 +00:00
|
|
|
isless()
|
|
|
|
determines (x) < (y) without an exception if x or y is NaN.
|
|
|
|
.TP
|
|
|
|
islessequal()
|
|
|
|
determines (x) <= (y) without an exception if x or y is NaN.
|
|
|
|
.TP
|
|
|
|
islessgreater()
|
|
|
|
determines (x) < (y) || (x) > (y) without an exception if x or y is NaN.
|
|
|
|
This macro is not equivalent to x != y because that expression is
|
|
|
|
true if x or y is NaN.
|
|
|
|
.TP
|
|
|
|
isunordered()
|
|
|
|
is true if x or y 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)
|