LN

All functions > MATH > LN

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

Signatures

Returns: Natural logarithm result

LN(number: T) → DOUBLE
sql
ParameterTypeRequiredDescription
numberTYesPositive number to find the natural log of

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

FeatureQL
SELECT
    f1 := LN(1.0e0),  -- Natural log of 1 is 0
    f2 := LN(2.718281828459045e0),  -- Natural log of e is 1
    f3 := LN(10.0e0),  -- Natural log of 10
    f4 := LN(0.5e0),  -- Natural log less than 1
    f5 := LN(100.0e0)  -- Natural log of 100
;
Result
f1 VARCHARf2 VARCHARf3 VARCHARf4 VARCHARf5 VARCHAR
0.01.02.302585092994046-0.69314718055994534.605170185988092

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19