JS:Math的常用方法 发表于 2019-03-13 | 分类于 JS | | 阅读数 字数统计: 134 字 | 阅读时长 ≈ 1 分钟 12345678910111. Math.sqrt():计算平方根2. Math.cbrt():计算立方根3. Math.pow(a, b):计算a的b次方4. Math.max(a,b,c...):计算最大值5. Math.min(a,b,c...):计算最小值6. Math.abs():求绝对值 7. Math.ceil():向上取整8. Math.floor():向下取整9. Math.random():取得一个[0.0,1.0)的随机数 10. Math.rint(): 四舍五入,返回double值。注意.5的时候会取偶数11. Math.round(): 四舍五入,float时返回int值,double时返回long值 打赏 微信支付 支付宝 -------------本文结束 感谢您的阅读-------------