fp_class(3C) fp_class(3C)
fp_class, fp_class_d, fp_class_f - classes of IEEE floating-point values
fp_class_l - classes of long double floating-point values
#include <fp_class.h>
int fp_class_d(double x);
int fp_class_f(float x);
int fp_class_l(long double x);
(Note that the long double routines are only valid for the MIPSpro
compilers.) Long double function fp_class_l has been renamed to be
compliant with the ANSI-C standard, however to be backward compatible, it
may still be called with the name fp_class_q.
These routines are used to determine the class of IEEE or long double
floating-point values. They return one of the constants in the file
<fp_class.h> and never cause an exception even for signaling NaN's.
These routines are to implement the recommended function class(x) in the
appendix of the IEEE 754-1985 standard for binary floating-point
arithmetic.
The constants in <fp_class.h> refer to the following classes of values:
Constant Class
FP_SNAN Signaling NaN (Not-a-Number)
FP_QNAN Quiet NaN (Not-a-Number)
FP_POS_INF +oo (positive infinity)
FP_NEG_INF -oo (negative infinity)
FP_POS_NORM positive normalized non-zero
FP_NEG_NORM negative normalized non-zero
FP_POS_DENORM positive denormalized
FP_NEG_DENORM negative denormalized
FP_POS_ZERO +0.0 (positive zero)
FP_NEG_ZERO -0.0 (negative zero)
Note that these functions are distinct from the SVR4 function fpclass
(see isnan(3C)).
isnan(3C).
ANSI/IEEE Std 754-1985, IEEE Standard for Binary Floating- Point
Arithmetic
In the case of long doubles, non-zero numbers less than 2**-916 in
absolute value are classified as denormalized, since one of the numbers
used in their representation may be a denormal double.
PPPPaaaaggggeeee 1111 [ Back ]
|