Python cmath.log() နည်းလမ်း
ဥပမာ
ရှုပ်ထွေးသောတန်ဖိုး၏ လော့ဂရစ်သမ်ကို ရှာပါ-
#Import cmath Library
import cmath
#print log value of some given
parameters
print (cmath.log(1+ 1j))
print (cmath.log(1, 2.5))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
cmath.log()
နည်းလမ်းသည် ရှုပ်ထွေးသောတန်ဖိုး၏ လော့ဂရစ်သမ်ကို ပြန်ပေးသည် ။
အငြင်းအခုံတစ်ခုတည်းဖြင့်၊ ဤနည်းလမ်းသည် ထိုအငြင်းအခုံ၏ သဘာဝလဂရစ်သမ်ကို အခြေခံ e ဖြင့် ပြန်ပေးသည်။
အငြင်းအခုံနှစ်ခုဖြင့်၊ ဤနည်းလမ်းသည် ပထမအငြင်းအခုံ (x) ၏ လော့ဂရစ်သမ်ကို ဒုတိယအငြင်းအခုံ (base) ၏အခြေခံဖြင့် ပြန်ပေးသည်။
အထားအသို
cmath.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' |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဂဏန်း complex တစ်ခု၏ သဘာဝ လောဂရစ်သမ်ကို ကိုယ်စားပြုသော တန်ဖိုးတစ်ခု သို့မဟုတ် ဂဏန်း၏ လော့ဂရစ်သမ်သည် အခြေခံမှ ကိန်းဂဏန်းအထိ ဖြစ်သည်။ |
---|---|
Python ဗားရှင်း- | ဗားရှင်း 2.4 တွင် ပြောင်းလဲခဲ့သည်။ |
Python Changelog- | အခြေခံဘောင်ကို ထည့်သွင်းခဲ့သည်။ |