Math round floor ceil

Math.floor(x)  是比x小的最大值,

Math.floor 求最大的整数但不大于本身.。


Math.round(x)  


   public static long round(double a) {

return (long)floor(a + 0.5d);

    }


Math.ceil(x) 是比x大的最小值

Math.ceil 求最小的整数但不小于本身. 

猜你喜欢

转载自yz-miaomiao.iteye.com/blog/1169150
今日推荐