- 具体规则应该是原数加0.5然后向下取整。
System.out.println(Math.round(7.5) + " " + Math.round(-7.5)); // 8 -7
System.out.println(Math.round(7.5) + " " + Math.round(-7.6)); // 8 -8
System.out.println(Math.round(7.5) + " " + Math.round(-7.4)); // 8 -7
System.out.println(Math.round(7.5) + " " + Math.round(-7.5)); // 8 -7
System.out.println(Math.round(7.5) + " " + Math.round(-7.6)); // 8 -8
System.out.println(Math.round(7.5) + " " + Math.round(-7.4)); // 8 -7