Python cmath.e 常量

实例

打印欧拉数 e:

  1. #导入 cmath 库
  2. import cmath
  3. # 打印欧拉数
  4. print (cmath.e)

定义与用法

cmath.e 常量返回自然常数(欧拉数): 2.718281828459045。


语法

  1. cmath.e

技术细节

返回值:一个 float 值, 2.718281828459045, 表示自然常数 e
Python 版本:1.5

分类导航