Python matematik.lgamma() Yöntemi
Örnek
Farklı sayıların log gama değerini bulun:
# Import math Library
import math
# Return the log gamma value of
different numbers
print (math.lgamma(7))
print (math.lgamma(-4.2))
Tanım ve Kullanım
Yöntem math.lgamma()
, bir sayının doğal logaritma gama değerini döndürür.
İpucu: Gama değerini bulmak için yöntemi kullanarak log gamma değerini de bulabilir math.gamma()
ve ardından math.log()
bu değerin günlüğünü hesaplamak için yöntemi kullanabiliriz.
İpucu: Gama değeri faktöriyel(x-1)'e eşittir.
Sözdizimi
math.lgamma(x)
Parametre Değerleri
Parameter | Description |
---|---|
x | Required. The number to find the log gamma value of. If the number is a negative integer, it returns a ValueError. If it is not a number, it returns a TypeError. |
Teknik detaylar
Geri dönüş değeri: | Bir float sayının log gama değerini temsil eden bir değer |
---|---|
Python Sürümü: | 3.2 |