log2

description

Syntax

DOUBLE log2(DOUBLE x) Returns the natural logarithm of x to base 2.

example

  1. mysql> select log2(1);
  2. +-----------+
  3. | log2(1.0) |
  4. +-----------+
  5. | 0 |
  6. +-----------+
  7. mysql> select log2(2);
  8. +-----------+
  9. | log2(2.0) |
  10. +-----------+
  11. | 1 |
  12. +-----------+
  13. mysql> select log2(10);
  14. +--------------------+
  15. | log2(10.0) |
  16. +--------------------+
  17. | 3.3219280948873622 |
  18. +--------------------+

keywords

  1. LOG2