Python math.lgamma() နည်းလမ်း
ဥပမာ
မတူညီသောနံပါတ်များ၏ log gamma တန်ဖိုးကိုရှာပါ
# Import math Library
import math
# Return the log gamma value of
different numbers
print (math.lgamma(7))
print (math.lgamma(-4.2))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
နည်းလမ်း သည် math.lgamma()
ကိန်းတစ်ခု၏ သဘာဝ လော့ဂရစ်သမ် ဂမ်မာတန်ဖိုးကို ပြန်ပေးသည်။
အကြံပြုချက်-math.gamma()
ဂမ်မာတန်ဖိုးကို ရှာရန် နည်းလမ်းကို အသုံးပြု၍ log gamma တန်ဖိုးကိုလည်း ရှာတွေ့နိုင်ပြီး math.log()
ထိုတန်ဖိုး၏ မှတ်တမ်းကို တွက်ချက်ရန် နည်းလမ်းကို အသုံးပြုပါ။
အကြံပြုချက်- gamma တန်ဖိုးသည် factorial(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 တစ်ခု၏ log gamma တန်ဖိုးကို ကိုယ်စားပြုသော တန်ဖိုး |
---|---|
Python ဗားရှင်း- | ၃.၂ |