Function exp #
计算一个值的指数。对于矩阵,如果你想要方阵的矩阵指数,请使用 expm 函数;如果你想计算每个元素的指数,请参阅示例。
Syntax #
math.exp(x)
Parameters #
| Parameter | Type | Description |
|---|---|---|
x |
number | BigNumber | Complex | 需要进行指数运算的数字 |
Returns #
| Type | Description |
|---|---|
| number | BigNumber | Complex | x 的指数 |
Throws #
Type | Description —- | ———–
Examples #
math.exp(2) // returns number 7.3890560989306495
math.pow(math.e, 2) // returns number 7.3890560989306495
math.log(math.exp(2)) // returns number 2
math.map([1, 2, 3], math.exp)
// returns Array [
// 2.718281828459045,
// 7.3890560989306495,
// 20.085536923187668
// ]