java script 算术对象

java script 算术对象 Math()

1.Math.E;     返回一个算术常量E2.718

2.Math.PI;       返回一个圆周率

3.Math.abs(n)   返回参数n的绝对值

4.Math.ceil(n)   对参数n进行向上取整并返回

5.Math.floor(n)    对参数n进行向下取整并返回

6.Math.pow(n,q)    返回n的q词幂

7.Math.sqrt(n)   返回参数n的平方根

8.Math.round(n)  对参数n进行四舍五入取整并返回

9.Math.random()  随机产生一个介于0到1之间的数  

posted @ 2018-09-05 11:07  破浪的小鱼  阅读(172)  评论(0编辑  收藏  举报