Python/ref cmath nan

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

<languages />

Python cmath.nan常数

❮cmath方法

打印nan的值:

    #Import cmath Library
import cmath 

# Print the value of nan

    print (cmath.nan)

定义和用法

The cmath.nan 常量返回浮点nan(非数字)值。此值不是合法数字。

nan常数等于 float("nan") or math.nan .

句法

    cmath.nan
  

技术细节

返回值: A

float 值,nan(非数字)

Python版本: 3.6

❮cmath方法