java 中的 Math.round(-1.5) 等于多少?

public class Mathround {
public static void main(String[] args) {
//取值数轴右边的整数
System.out.println(Math.round(-0.5));//0
System.out.println(Math.round(-1.5));//-1
System.out.println(Math.round(-2.5));//-2

}
}
posted @ 2020-08-07 20:12  Monica_维维  阅读(886)  评论(0编辑  收藏  举报