Python math.gamma() Metodo
Esempio
Trova la funzione gamma di diversi numeri:
# 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))
Definizione e utilizzo
Il math.gamma()
metodo restituisce la funzione gamma in corrispondenza di un numero.
Suggerimento: per trovare il valore gamma log di un numero, utilizzare il math.lgamma()
metodo.
Sintassi
math.gamma(x)
Valori dei parametri
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. |
Dettagli tecnici
Valore di ritorno: | Un float valore, che rappresenta la funzione gamma in x |
---|---|
Versione Python: | 3.2 |