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
}
}
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
}
}