Function log1p #
计算 value+1 的对数。
对于矩阵,该函数逐元素求值。
Syntax #
math.log1p(x)
math.log1p(x, base)
Parameters #
| Parameter | Type | Description |
|---|---|---|
x |
number | BigNumber | Complex | Array | Matrix | 要计算 x+1 对数的值。 |
base |
number | BigNumber | Complex | 对数的可选底数。如果未提供,则计算 x+1 的自然对数。默认值:e。 |
Returns #
| Type | Description |
|---|---|
| number | BigNumber | Complex | Array | Matrix | 返回 x+1 的对数 |
Throws #
Type | Description —- | ———–
Examples #
math.log1p(2.5) // returns 1.252762968495368
math.exp(math.log1p(1.4)) // returns 2.4
math.pow(10, 4) // returns 10000
math.log1p(9999, 10) // returns 4
math.log1p(9999) / math.log(10) // returns 4