Python – cmath.nanj Constant
cMath module contains a number of functions which is used for mathematical operations for complex numbers. The cmath.nanj Constant is used to get the complex nan (Not a Number).
Syntax: cmath.nanj
Returns: Return the complex nan value.
Below examples illustrate the use of above function:
Example #1 :
Python3
# Python code to implement # the cmath.nanj constant # importing "cmath" # for mathematical operations import cmath # Print the value of nanj val = cmath.nanj print (val) |
Output:
nanj
Example #2:
Python3
# Python code to implement # the cmath.nanj constant # importing "cmath" # for mathematical operations import cmath # use of cmath.nanj val = type (cmath.nanj) print (val) |
Output:
<class 'complex'>