Python cmath.isfinite() Yöntemi
Örnek
Karmaşık bir değerin sonlu olup olmadığını kontrol edin:
#import cmath for complex number operations
import cmath
#find
whether a complex number is finite or not
print (cmath.isfinite(2 + 3j))
print (cmath.isfinite(complex(5.0,float('inf'))))
print
(cmath.isfinite(float('inf')+ 5j))
Tanım ve Kullanım
Yöntem cmath.isfinite()
, karmaşık bir değerin sonlu olup olmadığını kontrol eder. Bu yöntem bir Boole değeri döndürür: True
değer sonluysa, aksi takdirde False
.
Sözdizimi
cmath.isfinite(x)
Parametre Değerleri
Parameter | Description |
---|---|
x | Required. The value to check if it is finite or not |
Teknik detaylar
Geri dönüş değeri: | Bir bool değer, True eğer değer sonlu ise, aksi takdirdeFalse |
---|---|
Python Sürümü: | 3.2 |