Python/ref cmath nanj

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

<languages />

Python cmath.nanj常数

❮cmath方法

打印nanj的值:

    #Import cmath Library
import cmath 

# Print the value of nan

    print (cmath.nanj)
print (type(cmath.nanj))

定义和用法

The cmath.nanj 常量返回一个复杂的nan(非数字)值。该值的实部为0,而nan为虚部。

nanj常数等于 complex(0.0,float("nan") .

句法

    cmath.nanj
  

技术细节

返回值: A

complex 值,nan(非数字)

Python版本: 3.6

❮cmath方法