Python cmath.inf Constante
Exemple
Imprimer l'infini positif et négatif :
#Import cmath Library
import cmath
# Print the positive infinity
print (cmath.inf)
# Print the negative infinity
print (-cmath.inf)
Définition et utilisation
La cmath.inf
constante renvoie un infini positif à virgule flottante.
Pour l'infini négatif, utilisez -cmath.inf
.
La constante cmath.inf est équivalente à float("inf")
.
Syntaxe
cmath.inf
Détails techniques
Valeur de retour : | Une float valeur, représentant la valeur de l'infini positif |
---|---|
Version Python : | 3.6 |