---
title: "exp(): IR builder function in typeshade/core/ir, TypeShade"
description: "exp, an IR builder function in typeshade/core/ir. exp(x): eˣ, component-wise. exp2 is the base-2 form."
url: https://typeshade.dev/api/exp/
language: en
---

# `exp()`

Function in Builtins

`exp(x)`: eˣ, component-wise. `exp2` is the base-2 form.

`import { exp } from 'typeshade/core/ir'`

This export returns an IR node. A `"use typeshade"` file calls the builtin itself: [`exp()`](https://typeshade.dev/reference/functions/exp/)

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
const exp: <K extends FloatKey>(x: ReadonlyNode<K>) => Node<K>
```

## Parameters

**`x` `ReadonlyNode<K>`**

## Return value

`Node<K>`

## Examples

### Example

```ts
import { fn, exp, f32T } from 'typeshade/core/ir'

const decay = fn('decay', { t: f32T }, ({ t }) => exp(t.mul(-1)))
```

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | `exp(x)`. |
| GLSL ES 3.00 (WebGL2) | Supported | `exp(x)`. |
| CPU oracle | Supported | Evaluated in `f64` by the oracle. |

## See also

- [`exp()`](https://typeshade.dev/reference/functions/exp/)
- [`exp2`](https://typeshade.dev/api/exp2/)

## Source

[`src/core/ir/node.ts`, line 1175](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L1175), at commit af54ddad5
