Python – cmath.e 常量
cMath 模块包含许多用于复数数学运算的函数。 cmath.e常量用于获取 eular 的编号。
Syntax: cmath.e
Returns: Return the e value.
下面的例子说明了上述函数的使用:
示例 #1:
Python3
# Python code to implement
# the cmath.e constant
# importing "cmath"
# for mathematical operations
import cmath
# Print the value of Euler e
val = cmath.e
print(val)
Python3
# Python code to implement
# the cmath.e constant
# importing "cmath"
# for mathematical operations
import cmath
# Print the value of e ^ 2
val = cmath.e ** 2
print(val)
输出:
2.718281828459045
示例 2:
Python3
# Python code to implement
# the cmath.e constant
# importing "cmath"
# for mathematical operations
import cmath
# Print the value of e ^ 2
val = cmath.e ** 2
print(val)
输出:
7.3890560989306495