(PHP 4, PHP 5, PHP 7, PHP 8)
log — 自然對數
$arg, float $base = M_E): float
如果指定了可選的參數 base,log()
返回 logbase
arg,否則 log()
返回參數 arg 的自然對數。
arg要計算對數的值
baseThe optional logarithmic base to use (defaults to 'e' and so to the natural logarithm).
返回 logbase
arg,或者它的自然對數。
| 版本 | 說(shuō)明 |
|---|---|
| 4.3.0 |
可選參數 base可用。
你可以計算任意以 b 為底 n
的對數,但其實(shí)使用的是數學(xué)等式:logb(n) =
log(n)/log(b),其中 log 是自然對數。
|