---
title: "Math.pow: Math member in the TypeShade language reference"
description: "Math.pow, a Math member in the TypeShade language reference. Returns x raised to the power of y; x ** y is the same operation."
url: https://typeshade.dev/reference/math/pow/
language: en
---

# `Math.pow`

Math member

Returns `x` raised to the power of `y`; `x ** y` is the same operation.

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

```ts
Math.pow(base: number, exponent: number): number
```

A `number` in a parameter or a return position is the scalar slot. The ambient file declares a GPU scalar as a branded number whose brand is optional, so a literal and any branded scalar both fill it.

`type f32 = number & { readonly [f32Tag]?: true }`

A `number` you write as a type is inferred from its uses, and `f32`, `i32` and `u32` fix a width; [the TypeScript constructs page](https://typeshade.dev/guide/language/from-typescript/) carries that row with the compiler's emit.

## Parameters

- `base` `number`
- `exponent` `number`

## Return value

`number`

## Description

The GPU result is undefined when `x` is negative, when `x` is 1 and `y` is infinite, and when `x` is infinite and `y` is 0, and on GLSL ES 3.00 also when `x` is 0 and `y` is 0 or less. The CPU oracle gives JavaScript's special values (`Math.pow(-2., 3.)` is -8 and `Math.pow(-2., 0.5)` is NaN); a finite result is the compiler's own libm's, the same on every engine, and may differ from an engine's `Math.pow` in the last bit.

Evaluated in `f64` by the CPU oracle.

## See also

- [Math members](https://typeshade.dev/reference/math/)
- [`pow()` in `typeshade/core/ir`](https://typeshade.dev/api/pow/)
