Home >>Python cmath Module >Python cmath.isnan() Method
Python cmath.isnan() method in python is used to return a Boolean value(true or false) and to checks whether a value is nan (Not a Number), or not. If the value is Nan returns True otherwise False
Syntax:cmath.isnan(x)
Parameter | Description |
---|---|
X | It is a Required parameter used to check for NaN value |
import cmath
print (cmath.isnan(15 + float('nan')))
print (cmath.isnan(5 + 4j))
import cmath
print (cmath.isnan(8 + float('nan')))
print (cmath.isnan(2 + 7j))