会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
成风魄郎
博客园
首页
新随笔
联系
管理
订阅
2013年10月31日
JS中的Math.ceil和Math.floor函数的用法
摘要: Math.ceil(x) -- 返回大于等于数字参数的最小整数(取整函数),对数字进行上舍入Math.floor(x)--返回小于等于数字参数的最大整数,对数字进行下舍入例如:document.write(Math.ceil(5.99));document.write(Math.ceil(-5.99));document.write(Math.ceil(1.01));document.write(Math.ceil(-1.01));输出是:6-52-1
阅读全文
posted @ 2013-10-31 22:38 成风魄郎
阅读(1059)
评论(2)
推荐(0)
编辑
公告