Python | cmath.nan Constant
cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.nan Constant is used to get the floating-point nan (Not a Number).
Syntax: cmath.nan
Returns: Return the floating-point nan value.
Below examples illustrate the use of above function:
Example #1 :
Python3
import cmath
val = cmath.nan
print (val)
|
Output:
nan
Example #2:
Python3
import cmath
val = cmath.isnan(cmath.nan)
print (val)
|
Output:
True
Last Updated :
01 Jun, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...