Python math.expm1() 方法
实例
返回 Ex - 1:
#Import math Libraryimport math#Return the exponential ex-1print(math.expm1(32))print(math.expm1(-10.89))
定义与用法
math.expm1() 方法返回 Ex - 1,即 E 的 x 次幂,减 1。
‘E’ 是自然对数系统的基数(约为2.718282),x是传递给它的数字。
此函数比调用 math.exp() 函数多一个减 1.
语法
math.expm1(x)
参数值
| 参数 | 描述 |
|---|---|
| x | 必填。指定的指数 |
技术细节
| 返回值: | 一个 float 值, 代表 Ex - 1 |
|---|---|
| Python 版本: | 2.7 |