---
title: "exp2(): IR builder function in typeshade/core/ir, TypeShade"
description: "exp2, an IR builder function in typeshade/core/ir. exp2(x): 2ˣ, component-wise; the inverse of log2."
url: https://typeshade.dev/api/exp2/
language: en
---

# `exp2()`

Function in Builtins

`exp2`(x): 2ˣ, component-wise; the inverse of `log2`.

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

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

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

## Syntax

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

## Parameters

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

## Return value

`Node<K>`

## Targets

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

## See also

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

## Source

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