Math.pow

Did you know that you can read content offline by using one of these tools? If you would like to read offline MDN content in another format, let us know by commenting on Bug 665750.

Dash App

概要

base を exponent 乗した値、つまり、baseexponent の値を返します。

Math のメソッド(静的)
実装されたバージョン JavaScript 1.0
ECMAScript エディション ECMA-262

構文

Math.pow(base,exponent) 

引数

base
底となる数。
exponents
base を累乗する指数。

詳細

pow は Math オブジェクトの静的なメソッドなので、自ら生成した Math オブジェクトのメソッドとしてではなく、常に、Math.pow() として使用するようにしてください。

例

例:Math.pow の使用

function raisePower(x, y) {
   return Math.pow(x, y);
}

x が 7 で y が 2 の場合、raisePower は 49 (7 の 2 乗) を返します。

関連情報

タグ (3)