Skip to main content
Version: V1.0.0

LOG2

Declaration

LOG2(X)

Description

Returns the exponent of X with base 2.

Example

SELECT LOG2(65536);
+-------------+
| LOG2(65536) |
+-------------+
| 16 |
+-------------+
1 row in set (0.001 sec)

SELECT LOG2(-65536);
+--------------+
| LOG2(-65536) |
+--------------+
| NULL |
+--------------+
1 row in set, 1 warning (0.000 sec)