math.pow 和 Math.sqrt函数

1、 Math.pow(x,y)-- 返回底数的指定次幂
  • pow是power的缩写,中文"幂"的意思
  • 引用网址:http://www.dreamdu.com/javascript/Math.pow/


pow函数返回值

返回以x的y次幂,等同于xy的数值表达式

如果pow的参数过大而引起浮点溢出,返回Infinity

2、Math.sqrt  返回x的平方根

sqrt函数返回值

返回x的平方根

如果x小于0,返回NaN



你可能感兴趣的:(Android学习笔记)