Bookshelf Home | Contents | Index | PDF

### Math.pow() Method

This function returns the value of its first parameter raised to the power of its second parameter.

##### Syntax

Math.pow(x, y)

Parameter
Description

x

The number to be raised to a power

y

The power to which to raise x

##### Returns

The value of x to the power of y.

##### Usage

This function returns the value of x raised to the power of y.

##### Example

This example uses the Math.pow() function to determine which number is larger: 99^100 (99 to the 100th power) or 100^99 (100 to the 99th power). Note that if you attempt to use the Math.pow() method with numbers as large as those used in the example in Math.log() Method, the result returned is `Infinity`.

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("100^99 is greater than 99^100.");
}

##### See Also
 Siebel eScript Language Reference