Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fnumber%2Fln.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fnumber%2Fln.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `ln`

## Description

Computes the natural logarithm (base *e*) of a number.

## Syntax

Like many functions in DataPrime, `ln` supports<!-- --> [two notations](https://docs-docusaurus.kinsta.page/dataprime/language-reference/functions-reference/.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
ln(number: number): number
```

```
(number: number).ln(): number
```

## Arguments

| Name     | Type     | Required | Description                                         |
| -------- | -------- | -------- | --------------------------------------------------- |
| `number` | `number` | **true** | The number whose natural logarithm will be computed |

## Example

**Use case: Model exponential growth with Euler's number and natural logarithm**

Calculate the growth rate from observed data, then project future values using `e` and `ln`.

### Example data

```
{

    "initial_value": 500,

    "current_value": 1000,

    "time_since_start_hours": 10

}
```

### Example query

* Function notation
* Method notation

```
create growth_rate from ((1 / time_since_start_hours) * (ln(current_value / initial_value)))
```

```
create growth_rate from ((1 / time_since_start_hours) * ((current_value / initial_value).ln()))
```

### Example output

```
{

    "initial_value": 500,

    "current_value": 1000,

    "time_since_start_hours": 10,

    "growth_rate": 0.0693,

    "prediction_in_ten_hours": 1999.41

}
```
