LOG

All functions > MATH > LOG

Returns the logarithm of a number to a specified base.

Syntax

LOG(base, expr)
sql

Arguments

ParameterTypeRequiredDescription
baseDOUBLEYesThe base of the logarithm (must be positive and ≠ 1)
numberDOUBLEYesPositive number to find the log of

Returns

DOUBLE - Logarithm result

Notes

  • Both base and number must be positive
  • Base cannot be 1
  • LOG(base, 1) = 0 for any valid base
  • LOG(base, base) = 1 for any valid base
  • Returns NULL if any input is NULL
  • Common bases: 10 (common log), 2 (binary log), e (natural log)

Examples

Last update at: 2025/10/13 10:23:46