Méthode Python math.gamma()
Exemple
Trouvez la fonction gamma de différents nombres :
# Import math Library
import math
# Return the gamma function for
different numbers
print(math.gamma(-0.1))
print(math.gamma(8))
print(math.gamma(1.2))
print(math.gamma(80))
print(math.gamma(-0.55))
Définition et utilisation
La math.gamma()
méthode renvoie la fonction gamma à un nombre.
Astuce : Pour trouver la valeur logarithmique d'un nombre, utilisez la math.lgamma()
méthode .
Syntaxe
math.gamma(x)
Valeurs des paramètres
Parameter | Description |
---|---|
x | Required. A number to find the gamma function for. If the number is a negative integer, it returns a ValueError. If it is not a number, it returns a TypeError. |
Détails techniques
Valeur de retour : | Une float valeur, représentant la fonction gamma en x |
---|---|
Version Python : | 3.2 |