The cmath.isnan() function checks if the input argument is a NaN (Not a Number) value. NaN is a special floating-point value indicating that the result of a computation is undefined, unrepresentable, or not a number.
cmath.isnan(x)
x |
The value(real or complex) to be tested. If the input value is a real number, it is first converted to a complex number before the operation. |
The function returns True if x is a NaN , False otherwise.