Section 24.119. Math.pow( ): compute xy


24.119. Math.pow( ): compute xy

ECMAScript v1

24.119.1. Synopsis

Math.pow(x, y)

24.119.1.1. Arguments

x

The number to be raised to a power.


y

The power that x is to be raised to.

24.119.1.2. Returns

x to the power of y, xy

24.119.2. Description

Math.pow( ) computes x to the power of y. Any values of x and y may be passed to Math.pow( ). However, if the result is an imaginary or complex number, Math.pow( ) returns NaN. In practice, this means that if x is negative, y should be a positive or negative integer. Also, bear in mind that large exponents can easily cause floating-point overflow and return a value of Infinity.




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net