java 中 Math.round() Math.ceil() Math.floor()区别

来源:互联网 发布:人工智能股龙头杜闵梁 编辑:程序博客网 时间:2024/06/11 18:30
http://zhidao.baidu.com/question/266612157.html
打一个简单的比如有两个小数12.1和12.7Math.round()分别是12,和13         -------取最近的值、四舍五入Math.ceil()分别是12和12              ------取地板Math.floor()分别是13和13            ------取天花板
原创粉丝点击