Python cmath.sqrt() နည်းလမ်း
ဥပမာ
ရှုပ်ထွေးသောနံပါတ်၏ နှစ်ထပ်ကိန်းကို ရှာပါ-
#Import cmath Library
import cmath
#Return the square root of a
complex number
print (cmath.sqrt(2 + 3j))
print (cmath.sqrt(15))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
cmath.sqrt()
နည်းလမ်းသည် ရှုပ်ထွေးသောနံပါတ်တစ်ခု၏ နှစ်ထပ်ကိန်းကို ပြန်ပေးသည် ။
မှတ်ချက်- နံပါတ်သည် 0 ထက်ကြီးသော သို့မဟုတ် ညီရပါမည်။
အထားအသို
cmath.sqrt(x)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
x | Required. A number to find the square root of. If the number is less than 0, it returns a ValueError. If the value is not a number, it returns a TypeError |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | complex ရှုပ်ထွေးသောနံပါတ်တစ်ခု၏ နှစ်ထပ်ကိန်းကို ကိုယ်စားပြုသော တန်ဖိုး တစ်ခု |
---|---|
Python ဗားရှင်း- | ၁.၅ |