Home » MySQL Math LOG2() Function

MySQL Math LOG2() Function

by Online Tutorials Library

MySQL LOG2() Function

The log2() is a Math function of MySQL. This function is used to get the base-2 logarithm of given number.

Syntax

Parameter:

number: It is the number for base-2 logarithm value.

Returns:

  1. This function returns the base-2 logarithm of a number.
  2. If the number is less than or equal to 0, this function will return NULL.

Example 1

Output:

MySQL Math LOG2() Function

Example 2

Output:

MySQL Math LOG2() Function

Next TopicMySQL Math

You may also like