طريقة Python math.lgamma ()
مثال
أوجد قيمة سجل غاما لأرقام مختلفة:
# Import math Library
import math
# Return the log gamma value of
different numbers
print (math.lgamma(7))
print (math.lgamma(-4.2))
التعريف والاستخدام
تُرجع math.lgamma()
الطريقة قيمة غاما اللوغاريتمية الطبيعية لرقم.
نصيحة: يمكننا أيضًا العثور على قيمة log gamma باستخدام math.gamma()
الطريقة للعثور على قيمة gamma ، ثم استخدام math.log()
الطريقة لحساب سجل تلك القيمة.
نصيحة: قيمة جاما تساوي عاملي (x-1).
بناء الجملة
math.lgamma(x)
قيمه المعامل
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. |
تفاصيل تقنية
قيمة الإرجاع: | قيمة float تمثل قيمة سجل غاما لرقم |
---|---|
نسخة بايثون: | 3.2 |