JS Math函数

http://www.xuanfengge.com/analysis-on-the-js-function-math-random.html 

Math对象的属性定义的函数和常量:

Math.pow(2,53)  2的53次幂
Math.round(.6)  1.0:四舍五入
Math.ceil(.6)  1.0:向上取整
Math.floor(.6)  0.0:向下取整
Math.abs(-5)  5:求绝对值
Math.max(x,y,z)  返回最大值
Math.min(x,y,z)  返回最小值
Math.random()  生成 0~1.0(不包括1.0) 的伪随机值
Math.PI  π:圆周率
Math.E  e:自然对数的底数
Math.sqrt(3)  3的平方根
Math.pw(3,1/3)  3的立方根
Math.sin(0)  三角函数:还有Math.cos,Math.atan等
Math.log(10)  10的自然对数
Math.log(100)/Math.LN10  以10为底数100的对数
Math.log(512)/Math.LN2  以2为底512的对数
Math.exp(3)  e的三次幂
原文地址:https://www.cnblogs.com/potato-lee/p/6423903.html