diff options
Diffstat (limited to 'man3/isgreater.3')
-rw-r--r-- | man3/isgreater.3 | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/man3/isgreater.3 b/man3/isgreater.3 new file mode 100644 index 000000000..1ae6978cd --- /dev/null +++ b/man3/isgreater.3 @@ -0,0 +1,61 @@ +.\" 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 +.BI "int isgreater(x,y); +.sp +.BI "int isgreaterequal(x,y); +.sp +.BI "int isless(x,y); +.sp +.BI "int islessequal(x,y); +.sp +.BI "int islessgreater(x,y); +.sp +.BI "int isunordered(x,y); +.fi +.sp +Link with \-lm. +.SH DESCRIPTION +The normal relation operations (like less) will fail if one of the +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. +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. +.TP +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. +.SH NOTE +Not all hardware supports these functions, and where it doesn't, they +will be emulated by macros. This will give you a performance penalty. +Don't use these functions if NaN is of no concern for you. +.SH "CONFORMING TO" +C99 +.SH "SEE ALSO" +.BR fpclassify (3) +.BR isnan(3) |