Python math.isqrt() နည်းလမ်း
ဥပမာ
စတုရန်းအမြစ်နံပါတ်ကို အောက်ဘက် အနီးဆုံးကိန်းပြည့်သို့ လှည့်ပါ။
# Import math Library
import math
# Print the square
root of different numbers
print (math.sqrt(10))
print (math.sqrt (12))
print (math.sqrt (68))
print (math.sqrt (100))
# Round square root
downward to the nearest integer
print (math.isqrt(10))
print
(math.isqrt (12))
print (math.isqrt (68))
print (math.isqrt (100))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
နည်းလမ်း သည် math.isqrt()
စတုရန်းအမြစ်နံပါတ်ကို အနီးဆုံးကိန်းပြည့်သို့ အောက်ဘက်သို့ ဝိုင်းသည်။
မှတ်ချက်- နံပါတ်သည် 0 ထက်ကြီးသော သို့မဟုတ် ညီရပါမည်။
အထားအသို
math.isqrt(x)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
x | Required. The number to round the square root of. If x is negative, it returns a ValueError. If x is not a number, it returns a TypeError |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | int ဒဿမများမပါဘဲ ဂဏန်းတစ်ခု၏ နှစ်ထပ်ကိန်းကို ကိုယ်စားပြု သည့် တန်ဖိုး |
---|---|
Python ဗားရှင်း- | ၃.၈ |