OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / man3 / isgreater.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" 2002-07-27 Walter Harms
4 .\" this was done with the help of the glibc manual
5 .\"
6 .TH ISGREATER 3  2008-08-05 "" "Linux Programmer's Manual"
7 .SH NAME
8 isgreater, isgreaterequal, isless, islessequal, islessgreater,
9 isunordered \- floating-point relational tests without exception for NaN
10 .SH SYNOPSIS
11 .nf
12 .B #include <math.h>
13 .sp
14 .BI "int isgreater(" x ", " y );
15 .sp
16 .BI "int isgreaterequal(" x ", " y );
17 .sp
18 .BI "int isless(" x ", " y );
19 .sp
20 .BI "int islessequal(" x ", " y );
21 .sp
22 .BI "int islessgreater(" x ", " y );
23 .sp
24 .BI "int isunordered(" x ", " y );
25 .fi
26 .sp
27 Link with \fI\-lm\fP.
28 .sp
29 .in -4n
30 Feature Test Macro Requirements for glibc (see
31 .BR feature_test_macros (7)):
32 .in
33 .sp
34 .ad l
35 All functions described here:
36 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
37 .I cc\ -std=c99
38 .ad b
39 .SH DESCRIPTION
40 The normal relation operations (like \fB<\fP, "less than")
41 will fail if one of the operands is NaN.
42 This will cause an exception.
43 To avoid this, C99 defines these macros.
44 The macros are guaranteed to evaluate their operands only once.
45 The operands can be of any real floating-point type.
46 .TP
47 .BR isgreater ()
48 determines \fI(x)\ >\ (y)\fP without an exception
49 if \fIx\fP or \fIy\fP is NaN.
50 .TP
51 .BR isgreaterequal ()
52 determines \fI(x)\ >=\ (y)\fP without an exception
53 if \fIx\fP or \fIy\fP is NaN.
54 .TP
55 .BR isless ()
56 determines \fI(x)\ <\ (y)\fP without an exception
57 if \fIx\fP or \fIy\fP is NaN.
58 .TP
59 .BR islessequal ()
60 determines \fI(x)\ <=\ (y)\fP without an exception
61 if \fIx\fP or \fIy\fP is NaN.
62 .TP
63 .BR islessgreater ()
64 determines \fI(x)\ < (y) || (x) >\ (y)\fP
65 without an exception if \fIx\fP or \fIy\fP is NaN.
66 This macro is not equivalent to \fIx\ !=\ y\fP because that expression is
67 true if \fIx\fP or \fIy\fP is NaN.
68 .TP
69 .BR isunordered ()
70 determines whether its arguments are unordered, that is, whether
71 at least one of the arguments is a NaN.
72 .SH RETURN VALUE
73 The macros other than
74 .BR isunordered ()
75 return the result of the relational comparison;
76 these macros return 0 if either argument is a NaN.
77
78 .BR isunordered ()
79 returns 1 if \fIx\fP or \fIy\fP is NaN and 0 otherwise.
80 .SH ERRORS
81 No errors occur.
82 .SH "CONFORMING TO"
83 C99, POSIX.1-2001.
84 .SH NOTES
85 Not all hardware supports these functions,
86 and where hardware support isn't provided, they will be emulated by macros.
87 This will result in a performance penalty.
88 Don't use these functions if NaN is of no concern for you.
89 .SH "SEE ALSO"
90 .BR fpclassify (3),
91 .BR isnan (3)