Pythoncmath.inf定数_
例
正と負の無限大を出力します。
#Import cmath Library
import cmath
# Print the positive infinity
print (cmath.inf)
# Print the negative infinity
print (-cmath.inf)
定義と使用法
cmath.inf
定数は、浮動小数点の正の無限大を返します。
負の無限大の場合は、を使用します-cmath.inf
。
cmath.inf定数は。と同等float("inf")
です。
構文
cmath.inf
技術的な詳細
戻り値: | 正の無限大のfloat 値を表す値 |
---|---|
Pythonバージョン: | 3.6 |