“Python/ref cmath nanj”的版本间差异

来自菜鸟教程
跳转至:导航、​搜索
(Pywikibot 4.4.0.dev0)
 
(机器人:添加分类Python基础教程
 
第49行: 第49行:
  
 
<br />
 
<br />
 +
 +
[[分类:Python基础教程]]

2020年10月29日 (四) 08:49的最新版本

<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方法