Python math.log() နည်းလမ်း
ဥပမာ
မတူညီသော ဂဏန်းများ၏ သဘာဝ လော့ဂရစ်သမ်ကို ရှာပါ။
# Import math Library
import math
# Return the natural logarithm
of different numbers
print(math.log(2.7183))
print(math.log(2))
print(math.log(1))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
နည်းလမ်းသည် ဂဏန်းတစ်ခု၏ သဘာဝ လော့ ဂ math.log()
ရစ်သမ် သို့မဟုတ် ဂဏန်း၏ လော့ဂရစ်သမ်ကို အခြေသို့ ပြန်ပေးသည်။
အထားအသို
math.log(x, base)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
x | Required. Specifies the value to calculate the logarithm for. If the value is 0 or a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
base | Optional. The logarithmic base to use. Default is 'e' |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဂဏန်း float တစ်ခု၏ သဘာဝ လောဂရစ်သမ်ကို ကိုယ်စားပြုသော တန်ဖိုးတစ်ခု သို့မဟုတ် ဂဏန်း၏ လော့ဂရစ်သမ်သည် အခြေခံမှ ကိန်းဂဏန်းအထိ ဖြစ်သည်။ |
---|---|
Python ဗားရှင်း- | ဗားရှင်း 2.3 တွင် ပြောင်းလဲခဲ့သည်။ |
မှတ်တမ်းပြောင်းရန်- | အခြေခံ ဘောင် ကို ထည့်သွင်းခဲ့သည်။ |