Math对象

Math

Math.PI:数字中的π 3.14...

Math.random():随机数,随机产生0-1之间的数,不包括1.

Math.round():四舍五入取整

Math.ceil():向上取整

Math.floor() : 向下取整

Math.max() : 参数是多个数字,求最大数字

Math.min() : 参数是多个数字,求最小数字

Math.pow(底数,指数):求幂

Math.sqrt():开根号

Math.abs():求绝对值

原文地址:https://www.cnblogs.com/zlf1914/p/12801737.html