---
title: "pow(): IR builder function in typeshade/core/ir, TypeShade"
description: "pow, an IR builder function in typeshade/core/ir. pow(a, b): a raised to the power b, component-wise."
url: https://typeshade.dev/api/pow/
language: en
---

# `pow()`

Function in Builtins

pow(a, b): a raised to the power b, component-wise.

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

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

## Syntax

```ts
function pow<K extends FloatKey>(a: ReadonlyNode<K>, b: NoInfer<ArithArg<K>>): Node<K>;
function pow(a: number, b: ReadonlyNode<'f32'>): Node<'f32'>;
```

## Parameters

**`a` `ReadonlyNode<K>`**

**`b` `NoInfer<ArithArg<K>>`**

## Return value

`Node<K>`

## Description

A JS number `b` lifts to the kind of `a`, so `pow(z, 4)` emits `pow(z, 4.0)` for an `f32` base. WGSL requires `a` and `b` to have the same type, so a vector `a` needs a vector `b`; a scalar `b` against a vector `a` passes the type check here and is rejected by the WGSL compiler.

## Targets

| Target | Support | Notes |
| --- | --- | --- |
| WGSL (WebGPU) | Supported | `pow(a, b)`. |
| GLSL ES 3.00 (WebGL2) | Supported | `pow(a, b)`. |
| CPU oracle | Supported | Evaluated in `f64` by the oracle. |

## In the guide

- [Values and mutation](https://typeshade.dev/guide/internals/values-and-mutation/)

## Source

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