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

jquery源码阅读知识储备(11)数学方法(四舍五入)

2011-04-06 22:15 531 查看
//1. Math.ceil()用作向上取整。

//2. Math.floor()用作向下取整。

//3. Math.round() 我们数学中常用到的四舍五入取整。

alert(Math.ceil(10/3));//4
alert(Math.floor(10/3));//3
alert(Math.round(10/3));//3
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: