Python math.nan-Konstante
Python math.nanGibt einen Gleitkommawert nan (keine Zahl) zurück, der keine gültige Zahl ist.
math.nanentspricht der Ausgabe vonfloat('nan')the output of
Syntax
Die Syntax der math.nan-Konstante ist wie folgt:
math.nan
Rückgabewert
Gibt eine Gleitkommazahl nan zurück.
Beispiel
Das folgende Beispiel gibt nan zurück:
Beispiel
# Importiere das math-Paket
import math
# Ausgabe nan
print (math.nan)
# Ausgabe nan-Typ
print (type(math.nan))
import math
# Ausgabe nan
print (math.nan)
# Ausgabe nan-Typ
print (type(math.nan))
Ausgabeergebnis:
nan <class 'float'>Andere Erweiterungen
Python math-Modul