Python cmath.inf Konstante
Beispiel
Drucken Sie die positive und negative Unendlichkeit:
#Import cmath Library
import cmath
# Print the positive infinity
print (cmath.inf)
# Print the negative infinity
print (-cmath.inf)
Definition und Verwendung
Die cmath.inf
Konstante gibt eine Gleitkommazahl positiv unendlich zurück.
Verwenden Sie für negative Unendlichkeit -cmath.inf
.
Die Konstante cmath.inf entspricht float("inf")
.
Syntax
cmath.inf
Technische Details
Rückgabewert: | Ein float Wert, der den Wert von positiv unendlich darstellt |
---|---|
Python-Version: | 3.6 |