LOG()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the logarithm of a value in either base-e or a specified base.
USAGE
LOG(base, number)
LOG(number)
Argument Name | Description |
---|---|
| The number to transform |
| Optional. The logarithmic base to use |
DETAILS
LOG()
is a mathematical function that returns a value's logarithm in the requested base:
When two arguments are provided, the logarithm returned is computed using the specified
base
When one argument is provided,
LOG()
works like LN() and returns a natural logarithm
LOG()
returns a value with a DOUBLE
data type. If the argument value or the computed value exceeds DOUBLE
precision, an error is returned.
A NULL
is returned if either argument is NULL
or the number
argument is less than or equal to zero.
EXAMPLES
SELECT LOG(10, 10), LOG(1);
+-------------+--------+
| LOG(10, 10) | LOG(1) |
+-------------+--------+
| 1 | 0 |
+-------------+--------+