Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 2.24 KB

fpclassify.md

File metadata and controls

68 lines (50 loc) · 2.24 KB
descriptiontitlems.dateapi_nameapi_locationapi_typef1_keywordshelpviewer_keywordsms.assetid
Learn more about: fpclassify
fpclassify
04/05/2018
fpclassify
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
HeaderDef
fpclassify
math/fpclassify
fpclassify macro
fpclassify function
bf549499-7ff9-4a58-8692-f2d1cb6bab81

fpclassify

Returns the floating-point classification of the argument.

Syntax

intfpclassify( /* floating-point */x ); intfpclassify( floatx ); // C++ onlyintfpclassify( doublex ); // C++ onlyintfpclassify( long doublex ); // C++ only

Parameters

x
The floating-point value to test.

Return value

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>.

ValueDescription
FP_NANA quiet, signaling, or indeterminate NaN
FP_INFINITEA positive or negative infinity
FP_NORMALA positive or negative normalized non-zero value
FP_SUBNORMALA positive or negative denormalized value
FP_ZEROA positive or negative zero value

Remarks

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.

Requirements

Function/MacroRequired header (C)Required header (C++)
fpclassify<math.h><math.h> or <cmath>

The fpclassify macro and fpclassify functions conform to the ISO C99 and C++11 specifications. For more compatibility information, see Compatibility.

See also

Math and floating-point support
isnan, _isnan, _isnanf

close