Java 小数取整 Math的用法
Posted by 聿歆 on 2010年05月28日
0 comments | 244 views
工作中遇到类似问题,特意收藏起来以备不时之需. 舍掉小数取整:Math.floor(2.0)=2 舍掉小数取整:Math.floor(2.1)=2 舍掉小数取整:Math.floor(2.5)=2 舍掉小数取整:Math.floor(2.9)=2 舍掉小数取整:Math.floor(-2.0)=-...
工作中遇到类似问题,特意收藏起来以备不时之需. 舍掉小数取整:Math.floor(2.0)=2 舍掉小数取整:Math.floor(2.1)=2 舍掉小数取整:Math.floor(2.5)=2 舍掉小数取整:Math.floor(2.9)=2 舍掉小数取整:Math.floor(-2.0)=-...