Raise Power Method

The Raise Power method raises the value that the x argument contains to the power of the value that the y argument contains. It returns the result in the x argument. For more information, see Get Logarithm Method.

Format

Math.pow(x, y)

The following table describes the arguments for the Raise Power method.

Argument Description

x

The number that this method raises.

y

The power to which this method raises the value that the x argument contains.

Example

This example uses the Raise Power method to determine which of the following numbers is larger:

  • 99^100 (99 to the 100th power)

  • 100^99 (100 to the 99th power):

function Test_Click ()
{
   var a = Math.pow(99, 100);
   var b = Math.pow(100, 99);
   if ( a > b ) 
      TheApplication().RaiseErrorText("99^100 is greater than 100^99.");
   else
      TheApplication().RaiseErrorText("99^100 is not greater than 100^99."); 
}