Python cmath.isinf() Yöntem
Örnek
Karmaşık bir değerin sonsuz olup olmadığını kontrol edin:
#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))
Tanım ve Kullanım
Yöntem cmath.isinf()
, bir değerin pozitif veya negatif sonsuz olup olmadığını kontrol eder. Bu yöntem bir Boole değeri döndürür: True
değer sonsuz ise, aksi takdirde False
.
Sözdizimi
cmath.isinf(x)
Parametre Değerleri
Parameter | Description |
---|---|
x | Required. The value to check for infinity |
Teknik detaylar
Geri dönüş değeri: | Bir bool değer, True eğer değer sonsuz ise, aksi takdirdeFalse |
---|---|
Python Sürümü: | 2.6 |