1ISGREATER(3)               Linux Programmer's Manual              ISGREATER(3)
2
3
4

NAME

6       isgreater,    isgreaterequal,   isless,   islessequal,   islessgreater,
7       isunordered - floating-point relational tests without exception for NaN
8

SYNOPSIS

10       #include <math.h>
11
12       int isgreater(x, y);
13
14       int isgreaterequal(x, y);
15
16       int isless(x, y);
17
18       int islessequal(x, y);
19
20       int islessgreater(x, y);
21
22       int isunordered(x, y);
23
24       Link with -lm.
25
26   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
27
28       All functions described here: _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE;
29       or cc -std=c99
30

DESCRIPTION

32       The  normal  relation operations (like <, "less than") will fail if one
33       of the operands is NaN.  This will cause an exception.  To avoid  this,
34       C99  defines these macros.  The macros are guaranteed to evaluate their
35       operands only once.  The operands can be  of  any  real  floating-point
36       type.
37
38       isgreater()
39              determines (x) > (y) without an exception if x or y is NaN.
40
41       isgreaterequal()
42              determines (x) >= (y) without an exception if x or y is NaN.
43
44       isless()
45              determines (x) < (y) without an exception if x or y is NaN.
46
47       islessequal()
48              determines (x) <= (y) without an exception if x or y is NaN.
49
50       islessgreater()
51              determines (x) < (y) || (x) > (y) without an exception if x or y
52              is NaN.  This macro is not equivalent  to  x != y  because  that
53              expression is true if x or y is NaN.
54
55       isunordered()
56              determines whether its arguments are unordered, that is, whether
57              at least one of the arguments is a NaN.
58

RETURN VALUE

60       The macros other than isunordered() return the result of the relational
61       comparison; these macros return 0 if either argument is a NaN.
62
63       isunordered() returns 1 if x or y is NaN and 0 otherwise.
64

ERRORS

66       No errors occur.
67

CONFORMING TO

69       C99, POSIX.1-2001.
70

NOTES

72       Not  all  hardware supports these functions, and where hardware support
73       isn't provided, they will be emulated by macros.  This will result in a
74       performance penalty.  Don't use these functions if NaN is of no concern
75       for you.
76

SEE ALSO

78       fpclassify(3), isnan(3)
79

COLOPHON

81       This page is part of release 3.25 of the Linux  man-pages  project.   A
82       description  of  the project, and information about reporting bugs, can
83       be found at http://www.kernel.org/doc/man-pages/.
84
85
86
87                                  2008-08-05                      ISGREATER(3)
Impressum