PHP: log() function
Description
The log() function returns the natural logarithm of a number.
Version:
(PHP 4 and above)
Syntax:
log(number,nbase)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
number | The value to calculate the logarithm. | Required | Float |
nbase | The base to use. Default is 'e'. | Optional | Float |
Return value:
The logarithm of number to nbase, if given, or the natural logarithm.
Value Type: Float.
Example :
Output :
0.69314718056 0.210260925483 -INF 0
View the example in the browser
See also