In C, isfinite() is a classification helper from <math.h>. It tells you whether a floating-point value is finite. Finite means the value is a real number you can work with — not infinity and not NaN. isfinite(3.5) is true. isfinite(INFINITY) is false.
You pass one floating-point argument. The result is non-zero (true) for finite values, including zero and normal numbers, and zero (false) for infinity or NaN. It is usually a macro (or macro-like function) that accepts float, double, or long double.
Syntax
Pass one floating-point value. Start with this call.
C
isfinite(3.5);
Call
What it does
isfinite(3.5)
Non-zero — 3.5 is finite.
isfinite(INFINITY)
Zero — infinity is not finite.
isfinite(NAN)
Zero — NaN is not finite.
Include <math.h>. Treat a non-zero result as true. Related checks: isinf(), isnan(), and the broader fpclassify().
Library declarations
C
int isfinite(real-floating x);
Parameters
Parameter
Description
x
Required. Any real floating type (float, double, or long double).
Return Value
Return Value
Description
Non-zero
x is finite (includes zero and normal / subnormal numbers).