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
description title ms.date api_name api_location api_type f1_keywords helpviewer_keywords ms.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

int fpclassify(
   /* floating-point */ x
);

int fpclassify(
   float x
); // C++ only

int fpclassify(
   double x
); // C++ only

int fpclassify(
   long double x
); // 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>.

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

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/Macro Required 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