您的位置:首页 > Web前端 > JavaScript

js里面Math对象常用属性

2017-08-06 18:26 211 查看
Math.max(n1,n2,n3)取得三个数中的最大值

Math.min(n1,n2,n3)取得三个数中的最小值

Math.PI取得π的值。

Math.E获得E的值

Math.pow(x,y)就是获得x的y次方

Math.sqrt(x)获得x开根的值

Math.abs(x)获得x的绝对值

Math.floor()向下取整

Math.ceil()向上取整

Math.round()四舍五入

Math.random();随机产生0-1之间的值
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: