title | ms.custom | ms.date | ms.reviewer | ms.suite | ms.tgt_pltfrm | ms.topic | apiname | apilocation | apitype | f1_keywords | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fpclassify | Microsoft Docs |
11/04/2016 |
article |
|
|
HeaderDef |
|
|
bf549499-7ff9-4a58-8692-f2d1cb6bab81 |
3 |
corob-msft |
corob |
ghogen |
Returns the floating-point classification of the argument.
int fpclassify(
/* floating-point */ x
);
int fpclassify(
float x
); // C++ only
int fpclassify(
double x
); // C++ only
int fpclassify(
long double x
); // C++ only
x
The floating-point value to test.
fpclassify
returns an integer value that indicates the floating-point class of the argument x
. This table shows the possible values returned by fpclassify
, defined in <math.h>.
Value | Description |
---|---|
FP_NAN |
A quiet, signaling, or indeterminate NaN |
FP_INFINITE |
A positive or negative infinity |
FP_NORMAL |
A positive or negative normalized non-zero value |
FP_SUBNORMAL |
A positive or negative denormalized value |
FP_ZERO |
A positive or negative zero value |
In C, fpclassify
is a macro; in C++, fpclassify
is a function overloaded using argument types of float
, double
, or long double
. In either case, the value returned depends on the effective type of the argument expression, and not on any intermediate representation. For example, a normal double
or long double
value can become an infinity, denormal, or zero value when converted to a float
.
Function/Macro | Required header (C) | Required header (C++) |
---|---|---|
fpclassify |
<math.h> | <math.h> or <cmath> |
The fpclassify
macro and fpclassify
functions conform to the C99 and C++11 specifications. For more compatibility information, see Compatibility.