Python cmath.nanj Constant

❮ cmath Methods


Example

Print the value of nanj:

#Import cmath Library
import cmath

# Print the value of nan
print (cmath.nanj)
print (type(cmath.nanj))
Try it Yourself »

Definition and Usage

The cmath.nanj constant returns a complex nan (Not a Number) value. This value has a 0 real part, and nan as the imaginarly part.

The nanj constant is equivalent to complex(0.0,float("nan").


Syntax

cmath.nanj

Technical Details

Return Value: A complex value, nan (Not a Number)
Python Version: 3.6

❮ cmath Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.