Example
Return the base-2 logarithm of 6:
sql
SELECT LOG2(6);
Definition and Usage
The LOG2() function returns the natural logarithm of a number to base-2.
Note: See also the LOG() function.
Syntax
text
LOG2(number)
Parameter Values
| Parameter | Description |
|---|---|
| number | A number. Must be greater than 0 |
Technical Details
| Works in: | From MySQL 4.0 |
|---|
More Examples
Example
Return the base-2 logarithm of 64:
sql
SELECT LOG2(64);