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