Python cmath.isfinite() နည်းလမ်း
ဥပမာ
ရှုပ်ထွေးသောတန်ဖိုးသည် အကန့်အသတ်ရှိမရှိ စစ်ဆေးပါ-
#import cmath for complex number operations
import cmath
#find
whether a complex number is finite or not
print (cmath.isfinite(2 + 3j))
print (cmath.isfinite(complex(5.0,float('inf'))))
print
(cmath.isfinite(float('inf')+ 5j))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
နည်းလမ်း သည် cmath.isfinite()
ရှုပ်ထွေးသောတန်ဖိုးသည် ကန့်သတ်ထားခြင်း ရှိ၊ မရှိ စစ်ဆေးသည်။ ဤနည်းလမ်းသည် Boolean တန်ဖိုးကို ပြန်ပေးသည်- True
အကယ်၍ တန်ဖိုးသည် ကန့်သတ်ထားပါက၊ မဟုတ်လျှင် False
.
အထားအသို
cmath.isfinite(x)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
x | Required. The value to check if it is finite or not |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | bool တန်ဖိုးတစ်ခု၊ တန်ဖိုး True သည် အကန့်အသတ်ဖြစ်လျှင်၊ မဟုတ်လျှင်False |
---|---|
Python ဗားရှင်း- | ၃.၂ |