Skip to content

power - Raise a value to a given exponent

The power function simulates raising a number to the power of an exponent.

Syntax

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

Arguments

Name Type Required Description
number number true The number to raise to the exponent, otherwise known as the base
exponent number true The exponent to which the base shall be raised, for example 2 is the equivalent of squaring our base

Example - Basic usage

If we have a numeric value, num and we wish to square it, we can do so with the following command:

create num_squared from power(num, 2)

We could also write this as a function of num:

create num_square from num.power(2)