Python/ref cmath inf

来自菜鸟教程
机器人讨论 | 贡献2020年10月29日 (四) 08:49的版本 (机器人:添加分类Python基础教程
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至:导航、​搜索

<languages />

Python cmath.inf常数

❮cmath方法

打印正负无穷大:

    #Import cmath Library
import cmath 

# Print the positive infinity

    print (cmath.inf)

# Print the negative infinity
print (-cmath.inf)

定义和用法

The cmath.inf 常数返回浮点正无穷大。

对于负无穷大,请使用 -cmath.inf .

cmath.inf常量等效于 float("inf") .

句法

    cmath.inf
  

技术细节

返回值: A

float 值,表示正无穷大的值

Python版本: 3.6

❮cmath方法