Open In App

Python – cmath.nanj Constant

Last Updated : 01 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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'>

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads