LOG
functionsupportedCore SQL functionsReturns the logarithm of a numeric expression.
Syntax
LOG(<base>, <expr>)
Parameters
| Name | Required | Description |
|---|---|---|
base | required | The “base” to use (e.g. 10 for base 10 arithmetic). This can be of any numeric data type (INTEGER, fixed-point, or floating point). base should be greater than 0. base should not be exactly 1.0. |
expr | required | The value for which you want to know the log. This can be of any numeric data type (INTEGER, fixed-point, or floating point). expr should be greater than 0. |
Returns
If the input expression is of type DECFLOAT, the returned type is DECFLOAT. Otherwise, the returned type is FLOAT.
Usage notes
- If base is 1 or less than or equal to 0, an error is returned.
- If expr is less than or equal to 0, an error is returned.