Open In App

Python - cmath.nanj Constant

Last Updated : 01 Jun, 2020
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
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'>

Article Tags :
Practice Tags :

Similar Reads