> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for LN function

# LN

Returns natural (base e) logarithm of a numerical expression.
The value for which `ln` is computed needs to be larger than 0, otherwise an error is returned.
You can use the function [LOG](/reference-sql/functions-reference/numeric/log) if you want to provide a different base.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
LN(<value>);
```

## Parameters

| Parameter | Description                                           | Supported input types |
| :-------- | :---------------------------------------------------- | :-------------------- |
| `<value>` | The value for which to compute the natural logarithm. | `DOUBLE PRECISION`    |

## Return Type

`DOUBLE PRECISION`

## Examples

The following example computes the natural logarithm of 1.0:

<div className="query-window">
  ```
  SELECT LN(1.0);
  ```

  | ln <span>double</span> |
  | :--------------------- |
  | 0                      |

  <p><span>Rows: 1</span><span>Execution time: 5.63ms</span></p>
</div>

The following example returns the natural logarithm close to e:

<div className="query-window">
  ```
  SELECT LN(2.7182818284590452353);
  ```

  | ln <span>double</span> |
  | :--------------------- |
  | 1                      |

  <p><span>Rows: 1</span><span>Execution time: 5.00ms</span></p>
</div>

The natural logarithm can only be computed for values that are larger than 0. All the following functions return an error:

<div className="query-window">
  ```
  SELECT LN(0.0);
  -- SELECT LN(-1.0);
  -- SELECT LN('-Inf');
  ```

  \|  |
  \|  |

  <p><span>Rows: 0</span><span>Execution time: 0.65ms</span></p>
</div>
