पायथन 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()
मान धनात्मक है या ऋणात्मक अनंत, या नहीं। यह विधि एक बूलियन मान लौटाती है: True
यदि मान अनंत है, अन्यथा False
।
वाक्य - विन्यास
cmath.isinf(x)
पैरामीटर मान
Parameter | Description |
---|---|
x | Required. The value to check for infinity |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | एक bool मान, True यदि मान अनंत है, अन्यथाFalse |
---|---|
पायथन संस्करण: | 2.6 |