MySQLNumeric FunctionsLOG
EXP

LOGNumeric Functions

LOG2

Returns the natural logarithm, or logarithm base b.

Syntax

LOG(x) / LOG(b, x)

Example

Enter values below to update the example in real time.

log2_result
SELECT LOG(2, 1024) AS log2_result;  -- 결과: 10