source: trunk/libs/newlib/src/newlib/libm/common/isgreater.c @ 452

Last change on this file since 452 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.8 KB
Line 
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.).  */
4/*
5FUNCTION
6<<isgreater>>, <<isgreaterequal>>, <<isless>>, <<islessequal>>, <<islessgreater>>, and <<isunordered>>---comparison macros
7INDEX
8        isgreater
9INDEX
10        isgreaterequal
11INDEX
12        isless
13INDEX
14        islessequal
15INDEX
16        islessgreater
17INDEX
18        isunordered
19
20SYNOPSIS
21        #include <math.h>
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]>);
28
29DESCRIPTION
30<<isgreater>>, <<isgreaterequal>>, <<isless>>, <<islessequal>>,
31<<islessgreater>>, and <<isunordered>> are macros defined for use in
32comparing floating-point numbers without raising any floating-point
33exceptions.
34
35The relational operators (i.e. <, >, <=, and >=) support the usual mathematical
36relationships between numeric values.  For any ordered pair of numeric
37values exactly one of the relationships--less, greater, and equal--is
38true.  Relational operators may raise the "invalid" floating-point
39exception when argument values are NaNs.  For a NaN and a numeric value, or
40for two NaNs, just the unordered relationship is true (i.e., if one or both
41of the arguments a NaN, the relationship is called unordered).  The specified
42macros are quiet (non floating-point exception raising) versions of the
43relational operators, and other comparison macros that facilitate writing
44efficient code that accounts for NaNs without suffering the "invalid"
45floating-point exception.  In the synopses shown, "real-floating" indicates
46that the argument is an expression of real floating type.
47
48Please note that saying that the macros do not raise floating-point
49exceptions, it is referring to the function that they are performing.  It
50is certainly possible to give them an expression which causes an exception.
51For example:
52o+
53o       NaN < 1.0
54                causes an "invalid" exception,
55o       isless(NaN, 1.0)
56                does not, and
57o       isless(NaN*0., 1.0)
58                causes an exception due to the "NaN*0.", but not from the
59resultant reduced comparison of isless(NaN, 1.0).
60o-
61
62RETURNS
63@comment Formatting note:  "$@" forces a new line
64No floating-point exceptions are raised for any of the macros.@*
65The <<isgreater>> macro returns the value of (x) > (y).@*
66The <<isgreaterequal>> macro returns the value of (x) >= (y).@*
67The <<isless>> macro returns the value of (x) < (y).@*
68The <<islessequal>> macro returns the value of (x) <= (y).@*
69The <<islessgreater>> macro returns the value of (x) < (y) || (x) > (y).@*
70The <<isunordered>> macro returns 1 if either of its arguments is NaN and 0 otherwise.
71
72PORTABILITY
73C99, POSIX.
74
75*/
Note: See TracBrowser for help on using the repository browser.