LOG2
Calculate base-2 logarithm. This function returns the logarithm of a number to the base 2.
Syntax
LOG2(X)Description
Examples
SELECT LOG2(4398046511104);
+---------------------+
| LOG2(4398046511104) |
+---------------------+
| 42 |
+---------------------+
SELECT LOG2(65536);
+-------------+
| LOG2(65536) |
+-------------+
| 16 |
+-------------+
SELECT LOG2(-100);
+------------+
| LOG2(-100) |
+------------+
| NULL |
+------------+Last updated
Was this helpful?

