问题描述:
Math.round?大侠们帮忙.
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(Math.round(-11.5));
System.out.println(Math.round(-12.4));
System.out.println(Math.round(-12.5));
System.out.println(Math.round(-12.6));
}
}
显示结果:
-11
-12
-12
-13
这些结果是怎么算出来的?
System.out.println(Math.round(-12.5));
System.out.println(Math.round(-12.6));
-12
-13
怎么结果不一样.
四舍六入五成双是什么意思?
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(Math.round(-11.5));
System.out.println(Math.round(-12.4));
System.out.println(Math.round(-12.5));
System.out.println(Math.round(-12.6));
}
}
显示结果:
-11
-12
-12
-13
这些结果是怎么算出来的?
System.out.println(Math.round(-12.5));
System.out.println(Math.round(-12.6));
-12
-13
怎么结果不一样.
四舍六入五成双是什么意思?
问题解答:
我来补答展开全文阅读