java中的几种取整函数
舍掉小数取整:Math.floor(2)=2 舍掉小数取整:Math.floor(2.1)=2 舍掉小数取整:Math.floor(2.5)=2 舍掉小数取整:Math.floor(2.9)=2 负数舍掉小数取整:Math.floor(-2)=-2 负数舍掉小数取整:Math.floor(-2.1)=-3 负数舍掉小数取整:Math.floor(-2.5)=-3 负数舍掉小数取整:Math.floor(-2.9)=-3 见小数取整:Math.ceil(2)=2 见小数取整:Math.ceil(2.1)=3 见小数取整:Math.ceil(2.5)=3 见小数取整:Math.ceil(2.9)=3 负数见小数取整:Math.ceil(-2)=-2 负数见小数取整:Math.ceil(-2.1)=-2 负数见小数取整:Math.ceil(-2.5)=-2 负数见小数取整:Math.ceil(-2.9)=-2
*****************************************************************************************************
--------------------------------------------------------------------------------------------------------------------------------------------
作者:Honey_Badger —— 觉得这文章好,点一下左下角
出处:http://tk55.cnblogs.com/
posted on 2016-11-09 14:40 Honey_Badger 阅读(17882) 评论(0) 编辑 收藏 举报