Home >>Python math Module >Python math.isinf() Method
Python math.isinf() method is used to check whether a given input value is positive or negative infinity, or not. It returns a Boolean value True if the value is infinity and False value if it is not.
Syntax:math.isinf(x)
Parameter | Description |
---|---|
x | This is a required parameter. It defines the value to check for infinity. |
import math
print (math.isinf (56))
print (math.isinf (-45.34))
print (math.isinf (float("nan")))
print (math.isinf (float("inf")))
print (math.isinf (math.inf))
import math
print (math.isinf (math.inf))
print (math.isinf (-math.inf))
print (math.isinf (float("nan")))
print (math.isinf (float("inf")))
print (math.isinf (float("-inf")))