power - Raise a value to a given exponent
The power
function simulates raising a number
to the power of an exponent
.
Syntax
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:
We could also write this as a function of num
:
Theme
Light