LN()
All functions > MATH > LN()
Returns the natural logarithm (base e) of a number.
Signatures
Natural logarithm
Returns: Natural logarithm of the input
LN(number: T) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | Positive floating-point number |
With:
T: Floating-point type (FLOAT, DOUBLE)
Signature notes:
- Only defined for positive numbers
LN(1.0) = 0,LN(e) = 1- Returns NULL if the input is NULL
- Returns negative infinity for 0, NaN for negative numbers
- Inverse of EXP:
LN(EXP(x)) = x
Examples
FeatureQL
SELECT
f1 := LN(1.0E0), -- ln(1) is 0
f2 := LN(2.718281828459045E0), -- ln(e) is 1
f3 := LN(10.0E0), -- Natural log of 10
f4 := LN(0.5E0) -- Natural log below 1 is negative
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR | f4 VARCHAR |
|---|---|---|---|
| 0.0 | 1.0 | 2.302585092994046 | -0.6931471805599453 |
On this page