Home >>Python math Module >Python math.isfinite() Method
Python math.isfinite() method in python Is used to returns a Boolean value means True if number neither an infinity nor a NaN (Not A Number), else it returns False and, it only accepts a number (float/ integer, infinite or NaN, finite).
Syntax:math.isfinite(x)
Parameter | Description |
---|---|
X | It is required a value to check whether it is finite or not |
import math
print (math.isfinite (34))
print (math.isfinite (-12.56))
print (math.isfinite (+56.12))
print (math.isfinite (float("nan")))
print (math.isfinite (float("inf")))
print (math.isfinite (math.inf))
print (math.isfinite (float("-inf")))
print (math.isfinite (-math.inf))
import math
print(math.isfinite(0))
print(math.isfinite(40))
print(math.isfinite(45.13))
print(math.isfinite(4.0))
print(math.isfinite(float('inf')))
print(math.isfinite(float('-inf')))
print(math.isfinite(float('nan')))