Python cmath.isfinite()メソッド
例
複素数値が有限かどうかを確認します。
#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))
定義と使用法
このcmath.isfinite()
メソッドは、複素数値が有限であるかどうかをチェックします。このメソッドはブール値を返します。True
値が有限の場合、それ以外の場合はFalse
。
構文
cmath.isfinite(x)
パラメータ値
Parameter | Description |
---|---|
x | Required. The value to check if it is finite or not |
技術的な詳細
戻り値: | bool 値が有限のTrue 場合は値、それ以外の場合は値False |
---|---|
Pythonバージョン: | 3.2 |