Python Math.gamma() Metoda
Przykład
Znajdź funkcję gamma różnych liczb:
# 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))
Definicja i użycie
Metoda math.gamma()
zwraca funkcję gamma w liczbie.
Wskazówka: Aby znaleźć logarytmiczną wartość gamma liczby, użyj math.lgamma()
metody.
Składnia
math.gamma(x)
Wartości parametrów
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. |
Szczegóły techniczne
Wartość zwrotu: | Wartość float reprezentująca funkcję gamma w x |
---|---|
Wersja Pythona: | 3.2 |