56.js中Math取整,四舍五入等

Math.abs() //Math.abs(x) x任意值 返回绝对值
Math.ceil()//Math.ceil(x) 向上取整,四舍五入
Math.cos()//余弦
Math.floor()//Math.floor(x) 向下取整
Math.max()// Math.max(...arg) 0个或多个参数返回最大的那个
Math.min()// Math.min(...arg) 0个或多个参数返回较小的那个
Math.pow()//Math.pow(2,3) 2的三次方
Math.random()//返回一个0.0-1.0之间 随机数
Math.sqrt()//Math.sqrt(x) x>0 计算平方根

原文地址:https://www.cnblogs.com/famLiu/p/7568678.html