Determine the class of IEEE floating-point values.
Format
#include <math.h>
int fp_class (double x);
int fp_classf (float x);
int fp_classl (long double x);
Arguments
- x
- An IEEE floating-point number.
Description
These functions determine the class of the specified IEEE
floating-point number, returning a constant from the <fp_class.h>
header file. They never cause an exception, even for signaling NaNs
(Not-a-Number). These functions implement the recommended class(x)
function 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:
FP_SNAN | Signaling NaN (Not-a-
Number) |
FP_QNAN |
Quiet NaN |
FP_POS_INF |
+infinity |
FP_NEG_INF |
-infinity |
FP_POS_NORM |
positive normalized |
FP_NEG_
NORM | negative normalized |
FP_POS_DENORM | positive denormalized |
FP_NEG_DENORM | negative
denormalized |
FP_POS_ZERO |
+0.0 (positive zero) |
FP_NEG_
ZERO | -0.0 (negative zero) |
Return Values
x | A constant from the <fp_class.h>
header file. |
Previous Page | Next Page | Table of Contents | Index