LOG2()
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 base-2 logarithm of the argument.
USAGE
LOG2(number)
Argument Name | Description |
---|---|
| The number to transform |
DETAILS
LOG2()
is a mathematical function that returns the base-2 logarithm of the argument. This is equivalent to LOG(2, number)
.
LOG2()
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 the argument is NULL
or less than or equal to zero.
EXAMPLES
SELECT LOG2(65536);
+-------------+
| LOG2(65536) |
+-------------+
| 16 |
+-------------+