पायथन 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 है, तो यह विधि सही है, अन्यथा यह गलत है।
वाक्य - विन्यास
math.isnan(x)
पैरामीटर मान
Parameter | Description |
---|---|
x | Required. The value to check |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | एक bool मान, True यदि मान NaN है, अन्यथाFalse |
---|---|
पायथन संस्करण: | 3.5 |