LN

All functions > MATH > LN

Returns the natural logarithm (base e) of a number.

Syntax

LN(number: T) → DOUBLE
sql

Type Parameters:

  • T: Any numeric type (TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL)

Arguments

ParameterTypeRequiredDescription
numberTYesPositive number to find the natural log of

Returns

DOUBLE - Natural logarithm result

Notes

  • Only defined for positive numbers (number > 0)
  • LN(1) = 0
  • LN(e) = 1 where e ≈ 2.718281828459045
  • Returns NULL if input is NULL
  • Returns negative infinity for LN(0)
  • Returns NaN for negative numbers
  • Inverse of EXP function: LN(EXP(x)) = x

Examples

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