Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fnumber%2Fpower.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Flanguage-reference%2Ffunctions-reference%2Fnumber%2Fpower.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `power`

## Description

Returns the result of raising a number to the power of an exponent.

## Syntax

Like many functions in DataPrime, `power` supports<!-- --> [two notations](https://coralogix.com/docs/docs/dataprime/language-reference/functions-reference/.md),<!-- --> **function** and **method**. These interchangeable forms allow flexibility in how you structure expressions.

* Function notation
* Method notation

```
power(number: number, exponent: number): number
```

```
(number: number).power(exponent: number): number
```

## Arguments

| Name       | Type     | Required | Description                                                   |
| ---------- | -------- | -------- | ------------------------------------------------------------- |
| `number`   | `number` | **true** | The base value to raise                                       |
| `exponent` | `number` | **true** | The exponent to raise the base to (e.g. `2` squares the base) |

## Example

**Use case: Square a number**

Raise a numeric field to the power of 2 to calculate its square.

### Example data

```
{

    "num": 7

}
```

### Example query

* Function notation
* Method notation

```
create num_squared from power(num, 2)
```

```
create num_squared from num.power(2)
```

### Example output

```
  {

      "num": 7,

      "num_squared": 49

  }
```
