This tutorial explains how to use the MySQL LOG2 function with syntax and examples.
The MySQL LOG2 function returns the base-2 logarithm of a number.
The syntax for the LOG2 function in MySQL is:
The number to take the base-2 logarithm of. Must be greater than 0.
The LOG2 function can be used in the following versions of MySQL:
Let's look at some MySQL LOG2 function examples and explore how to use the LOG2 function in MySQL.
For example: