Math是内置对象:系统提供

  直接使用,不用做其他处理,是数学对象,提供了数学方面的操作。

 1 Math.round();    //四舍五入
 2 Math.random();    //取随机数(指定范围)
 3 Math.abs();    //返回绝对值
 4 Math.ceil();    //向上取整
 5 Math.floor();    //向下取整
 6 Math.max();    //取最大值
 7 Math.min();    //取最小值
 8 Math.pow(a,b);    //求a的b次方
 9 Math.sqrt();    //开平方
10 Math.sin();    //求正弦(括号内用弧度表示)
11 Math.cos();    //求余弦(括号内用弧度表示)
12 Math.PI;    //直接用来计算(π值)
13 弧度 = Math.PI / 180 *deg;
posted on 2019-12-22 19:46  阿民啊  阅读(209)  评论(0编辑  收藏  举报