Math.round个人理解
最近看到一个问题Math.round(-1.5)输出的是-1,有点蒙蔽,不是四舍五入吗?遂搜了一些博客看了看,经过自己的总结,写篇博客记录一下
System.out.println("Math.round(1.6) "+Math.round(1.6));
System.out.println("Math.round(1.5) "+Math.round(1.5));
System.out.println("Math.round(1.4) "+Math.round(1.4));
System.out.println("Math.round(0.6) "+Math.round(0.6));
System.out.println("Math.round(0.5) "+Math.round(0.5));
System.out.println("M