Python math.nan-Konstante

Python math 模块Python math-Modul

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

Ausgabeergebnis:

nan
<class 'float'>

Python math 模块Python math-Modul

Andere Erweiterungen