Home >>Python cmath Module >Python cmath.isinf() Method
Python cmath.isinf() method in python is used to returns a Boolean value and checks whether a value is positive or negative infinity, or not. If the value is infinity it returns true, otherwise False.
Syntax:cmath.isinf(x)
Parameter | Description |
---|---|
x | It is a Required parameter used to check for infinity of the value |
import cmath
print (cmath.isinf(complex(6 + float('inf'))))
print (cmath.isinf(14 + 2j))
import cmath
print (cmath.isinf(complex(12 + float('inf'))))
print (cmath.isinf(10 + 5j))