Edit

isfinite, _finite, _finitef

Determines whether a floating-point value is finite.

Syntax

int isfinite(
   /* floating-point */ x
); /* C-only macro */

template <class FloatingType>
inline bool isfinite(
   FloatingType x
) throw(); /* C++-only template function */

int _finite(
   double x
);

int _finitef(
   float x
); /* x64 and ARM/ARM64 only */

Parameters

x
The floating-point value to test.

Return value

The isfinite macro and the _finite and _finitef functions return a non-zero value if x is a normal, subnormal, or signed zero (±0) finite value. They return 0 if the argument is infinite or Not a Number (NaN). The C++ inline template function isfinite behaves the same way but returns true or false.

Remarks

_finite and _finitef are Microsoft-specific.

isfinite is a macro when compiled as C, and an inline template function when compiled as C++.

_finitef is only available when compiling for the x64, ARM, ARM64, or ARM64EC platforms.

Requirements

Function Required header (C) Required header (C++)
isfinite <math.h> <math.h> or <cmath>
_finite <float.h> <float.h> or <cfloat>
_finitef <math.h> <math.h> or <cmath>

For more compatibility information, see Compatibility.

See also

Math and floating-point support
fpclassify
_fpclass, _fpclassf
isinf
isnan, _isnan, _isnanf
isnormal