Return the natural logarithm of different numbers:
<?php
echo(log(2.7183) . "<br>");
echo(log(2) . "<br>");
echo(log(1) . "<br>");
echo(log(0);
?>
Try it Yourself »
The log() function returns the natural logarithm of a number, or the logarithm of number to base.
log(
number,base);
Parameter | Description |
---|---|
number | Required. Specifies the value to calculate the logarithm for |
base | Optional. The logarithmic base to use. Default is 'e' |
Return Value: | The natural logarithm of a number, or the logarithm of number to base |
---|---|
Return Type: | Float |
PHP Version: | 4+ |
PHP Changelog: | PHP 4.3: The base parameter were added |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!