power() - Number Function | Zoho QEngine Help

power()

In a nutshell
The power() function takes a baseNumber and a powerNumber as arguments and returns the result of raising the base to the specified exponent as a decimal value. It follows standard exponentiation rules and is useful in test scripts that involve mathematical computations requiring exponential calculations.

Overview

The power() function takes baseNumber and powerNumber as arguments. It returns the baseNumber raised to the power of powerNumber.

Return Type

  • Decimal

Syntax

  1. <variable> = <baseNumber>.power( <powerNumber> );

(OR)

  1. <variable> = power(<baseNumber>, <powerNumber>);
ParameterDescriptionData type
<variable>Variable which will contain the returned value.DECIMAL
<baseNumber>Value to be raised to powerNumber.NUMBER or DECIMAL
<powerNumber>The power to which the baseNumber will be raised.NUMBER or DECIMAL

Examples

  1. numOne = 3;
  2. numTwo = 2;
  3. newValue = numOne.power(numTwo);       // returns 9