SQLite LOG() Function
Definition and Usage
The LOG() function returns a logarithm.
With one argument, it returns the base 10 logarithm of the number. With two arguments, the first argument is the base.
Note: Some SQLite builds do not include the math functions, because they need the compile option SQLITE_ENABLE_MATH_FUNCTIONS. They work in our editor.
Note: In some other databases, LOG() with one argument returns the natural logarithm. In SQLite, use LN() for that.
Tip: Also look at LN(), LOG10(), LOG2().
Syntax
LOG(number)
LOG(base, number)
Parameter Values
| Parameter | Description |
|---|---|
| base | Optional. The base. Default is 10 |
| number | Required. A number greater than 0 |
Technical Details
| Return type: | Real |
|---|---|
| Works in: | SQLite 3.35.0 and later |