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