Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Python – cmath.nanj Constant

  • Last Updated : 01 Jun, 2020

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'>
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!