Skip to main content

LN

Description

Returns the natural logarithm of x to base e.

Alias

  • DLOG1

Syntax

LN(<x>)

Parameters

ParameterDescription
<x>Antilogarithm should be greater than 0

Return value

Return a float-point number. Special cases:

  • If x IS NULL, return NULL

Example

select ln(1);
+-----------------------+
| ln(cast(1 as DOUBLE)) |
+-----------------------+
| 0.0 |
+-----------------------+
select ln(e());
+---------+
| ln(e()) |
+---------+
| 1.0 |
+---------+
select ln(10);
+------------------------+
| ln(cast(10 as DOUBLE)) |
+------------------------+
| 2.302585092994046 |
+------------------------+