Python cmath.nanj Konstante
Beispiel
Drucken Sie den Wert von nanj:
#Import cmath Library
import cmath
# Print the value of nan
print (cmath.nanj)
print (type(cmath.nanj))
Definition und Verwendung
Die cmath.nanj
Konstante gibt einen komplexen nan-Wert (Not a Number) zurück. Dieser Wert hat einen Realteil von 0 und nan als Imaginärteil.
Die Konstante nanj ist äquivalent zu complex(0.0,float("nan")
.
Syntax
cmath.nanj
Technische Details
Rückgabewert: | Ein complex Wert, nan (keine Zahl) |
---|---|
Python-Version: | 3.6 |