freeCodeCamp/guide/chinese/javascript/standard-objects/math/math-pow/index.md

608 B

title localeTitle
Math Pow 数学战

数学战

Math.pow()将数字的值返回到另一个数字的幂。

句法

Math.pow(base, exponent) ,其中base是碱值和exponent是由提高的数量base

pow()Math的静态方法,因此它总是被称为Math.pow()而不是另一个对象的方法。

例子

Math.pow(5, 2); // 25 
 Math.pow(7, 4); // 2401 
 Math.pow(9, 0.5); // 3 
 Math.pow(-8, 2); // 64 
 Math.pow(-4, 3); // -64 

更多信息:

MDN