---
title: "log"
description: "The natural logarithm of a value."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "math"
categorySlug: "math"
categoryTitle: "Math"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/math.ts#L184"
---

# log

The natural logarithm of a value.

```ts
log(x: Val): Expr
```

Import `math` from `shaders/std` and use `math.log`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `x` | `Val` |  |

## Example

```ts
const octave = log(max(scale, 1))
```

## See also

- [`exp`](/docs/primitives/math/exp) — e raised to the value.