Python math.isnan() နည်းလမ်း
ဥပမာ
တန်ဖိုးသည် NaN ဟုတ်မဟုတ် စစ်ဆေးပါ-
# Import math Library
import math
# Check whether some values are NaN
or not
print (math.isnan (56))
print
(math.isnan (-45.34))
print (math.isnan (+45.34))
print (math.isnan
(math.inf))
print (math.isnan (float("nan")))
print (math.isnan
(float("inf")))
print (math.isnan (float("-inf")))
print (math.isnan
(math.nan))
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
နည်းလမ်း သည် math.isnan()
တန်ဖိုးသည် NaN (နံပါတ်မဟုတ်) ဟုတ်မဟုတ် စစ်ဆေးသည်။
သတ်မှတ်ထားသောတန်ဖိုးသည် NaN ဖြစ်ပါက ဤနည်းလမ်းသည် True ပြန်ပေးသည်၊ သို့မဟုတ်ပါက False ပြန်ပေးသည်။
အထားအသို
math.isnan(x)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
x | Required. The value to check |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | bool တန်ဖိုး သည် True NaN ဖြစ်ပါက၊ မဟုတ်လျှင်False |
---|---|
Python ဗားရှင်း- | ၃.၅ |