java中Math的一些方法

floor: 求小于参数的最大整数。返回double类型----- n. 地板,地面
         例如:Math.floor(-4.2) = -5.0
-----------------------------------------------------------
ceil:   求大于参数的最小整数。返回double类型----- vt. 装天花板;
         例如:Math.ceil(5.6) = 6.0
-----------------------------------------------------------
round: 对小数进行四舍五入后的结果。返回int类型
         例如:Math.round(-4.6) = -5

猜你喜欢

转载自blog.csdn.net/qq_18975791/article/details/80654639
今日推荐