java中随机数的向上取整

版权声明:尊重原创 https://blog.csdn.net/qq_40163092/article/details/89671116

1.在java中Math.round(-1.5)的取值是多少?
答案:-1 因为java中的值是向上取整的 -0.5中间值在数轴上是向右取整的 所以0.5直接舍去。

猜你喜欢

转载自blog.csdn.net/qq_40163092/article/details/89671116
今日推荐