log is computed needs to be larger than 0, otherwise an error is returned.
If a base is provided, it also needs to be larger than 0 and not equal to 1.
You can use the function LN to compute the natural logarithm (base e).
Alias: LOG10 (does not support a custom base argument)
Syntax
Parameters
| Parameter | Description | Supported input types |
|---|---|---|
<base> | Optional. The base for the logarithm. The default base is 10. | DOUBLE PRECISION |
<value> | The value for which to compute the logarithm. | DOUBLE PRECISION |
Return Type
DOUBLE PRECISION
Example
The following example returns the logarithm of 64.0 to base 2:| log double |
|---|
| 6 |
Rows: 1Execution time: 5.31ms
| log double | log10 double |
|---|---|
| 2 | 2 |
Rows: 1Execution time: 5.68ms
Rows: 0Execution time: 0.69ms
Rows: 0Execution time: 0.68ms