1 /* isgreater.c: This file contains no source code, but rather only the
2 * man-page comments. All of the documented "functions" are actually macros
3 * defined in math.h (q.v.). */
6 <<isgreater>>, <<isgreaterequal>>, <<isless>>, <<islessequal>>, <<islessgreater>>, and <<isunordered>>---comparison macros
22 int isgreater(real-floating <[x]>, real-floating <[y]>);
23 int isgreaterequal(real-floating <[x]>, real-floating <[y]>);
24 int isless(real-floating <[x]>, real-floating <[y]>);
25 int islessequal(real-floating <[x]>, real-floating <[y]>);
26 int islessgreater(real-floating <[x]>, real-floating <[y]>);
27 int isunordered(real-floating <[x]>, real-floating <[y]>);
30 <<isgreater>>, <<isgreaterequal>>, <<isless>>, <<islessequal>>,
31 <<islessgreater>>, and <<isunordered>> are macros defined for use in
32 comparing floating-point numbers without raising any floating-point
35 The relational operators (i.e. <, >, <=, and >=) support the usual mathematical
36 relationships between numeric values. For any ordered pair of numeric
37 values exactly one of the relationships--less, greater, and equal--is
38 true. Relational operators may raise the "invalid" floating-point
39 exception when argument values are NaNs. For a NaN and a numeric value, or
40 for two NaNs, just the unordered relationship is true (i.e., if one or both
41 of the arguments a NaN, the relationship is called unordered). The specified
42 macros are quiet (non floating-point exception raising) versions of the
43 relational operators, and other comparison macros that facilitate writing
44 efficient code that accounts for NaNs without suffering the "invalid"
45 floating-point exception. In the synopses shown, "real-floating" indicates
46 that the argument is an expression of real floating type.
48 Please note that saying that the macros do not raise floating-point
49 exceptions, it is referring to the function that they are performing. It
50 is certainly possible to give them an expression which causes an exception.
54 causes an "invalid" exception,
58 causes an exception due to the "NaN*0.", but not from the
59 resultant reduced comparison of isless(NaN, 1.0).
63 @comment Formatting note: "$@" forces a new line
64 No floating-point exceptions are raised for any of the macros.@*
65 The <<isgreater>> macro returns the value of (x) > (y).@*
66 The <<isgreaterequal>> macro returns the value of (x) >= (y).@*
67 The <<isless>> macro returns the value of (x) < (y).@*
68 The <<islessequal>> macro returns the value of (x) <= (y).@*
69 The <<islessgreater>> macro returns the value of (x) < (y) || (x) > (y).@*
70 The <<isunordered>> macro returns 1 if either of its arguments is NaN and 0 otherwise.