LN
All functions > MATH > LN
Returns the natural logarithm (base e) of a number.
Signatures
Returns: Natural logarithm result
LN(number: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | Positive number to find the natural log of |
Notes
- Only defined for positive numbers (number > 0)
LN(1) = 0LN(e) = 1where 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 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR | f5 VARCHAR |
|---|---|---|---|---|
| 0.0 | 1.0 | 2.302585092994046 | -0.6931471805599453 | 4.605170185988092 |
On this page