COMPARE(3C)COMPARE(3C)NAME
isgreater, isgreaterequal, isless, islessequal, islessgreater,
isunordered, isgreaterf, isgreaterequalf, islessf, islessequalf,
islessgreaterf, isunorderedf, isgreaterl, isgreaterequall, islessl,
islessequall, islessgreaterl, isunorderedl
- comparison macros (and functions)
SYNOPSIS
#include <math.h>
int isgreater(real-floating x, real-floating y);
int isgreaterequal(real-floating x, real-floating y);
int isless(real-floating x, real-floating y);
int islessequal(real-floating x, real-floating y);
int islessgreater(real-floating x, real-floating y);
int isunordered(real-floating x, real-floating y);
DESCRIPTION
These routines are not available for programs compiled with the O32 ABI.
These macros are quiet versions of the relational operators, i.e. do not
raise floating-point exceptions. real-floating in the synopsis lines
indicates that the argument shall be an expression of real-floating type,
i.e. float, double, or long double. Each argument should be the same
type.
These macros are implemented in terms of ordinary functions depending on
the argument used; for example, if x and y are float expressionss, the
macro isgreater generates a call to the function isgreaterf. If x and y
are double expressions, the macro generates a call to the function
isgreater. If x and y are long double expressions, the macro generates a
call to the function isgreaterl.
The isgreater macro generates a function call to a function which returns
1 if its first argument is greater than its second argument, 0 otherwise.
The isgreaterequal macro generates a function call to a function which
returns 1 if its first argument is greater than or equal to its second
argument, 0 otherwise.
The isless macro generates a function call to a function which returns 1
if its first argument is less than its second argument, 0 otherwise.
The islessequal macro generates a function call to a function which
returns 1 if its first argument is less than or equal to its second
argument, 0 otherwise.
The islessgreater macro generates a function call to a function which
returns 1 if its first argument is less than or greater than its second
argument, 0 otherwise.
Page 1
COMPARE(3C)COMPARE(3C)
Each of the preceding macros returns 0 if either argument is a NaN,
without raising a floating-point exception.
The isunordered macro generates a function call to a function which
returns 1 if its arguments are unordered (i.e. if either argument is a
Nan), and 0 otherwise.
NOTES
Long double operations on this system are only supported in round to
nearest rounding mode (the default). The system must be in round to
nearest rounding mode when calling any of the long double functions, or
incorrect answers will result.
SEE ALSOmath(3M)
Page 2