java 中 Math.rint()

Math.rint()

**形参是 double

System.out.println(Math.rint(2.5));

返回 2.0

System.out.println(Math.rint(2.55));

返回3.0

正整数: .5 返回的是 * ,.51 返回的 是 * + 1

原文地址:https://www.cnblogs.com/zychengzhiit1/p/6226806.html