Skip to main content

POWER

Returns the result of a number raised to a power.

Syntax

expression.POWER(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe base number. It can be any real number.
arg2RequiredApiRange | ApiName | numberThe exponent to which the base number is raised.

Returns

number

Example

This example shows how to return the result of a number raised to a power.

// How to raise a number to a power.

// Use a function to calculate the result after raising a number to the power.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.POWER(23, 4));