Metoda Python math.gamma().
Příklad
Najděte gama funkci různých čísel:
# 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))
Definice a použití
Metoda math.gamma()
vrací funkci gama v čísle.
Tip: Chcete-li zjistit hodnotu log gama čísla, použijte math.lgamma()
metodu.
Syntax
math.gamma(x)
Hodnoty parametrů
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. |
Technické údaje
Návratová hodnota: | Hodnota float představující gama funkci v x |
---|---|
Verze Pythonu: | 3.2 |