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