java - Why does Math.round(0.49999999999999994) return 1 - Stack Overflow
source code in JDK 6 public static long round(double a) { return (long)Math.floor(a + 0.5d); } source code in JDK 7 public static long round(double a) { if (a != 0x1.fffffffffffffp-2) { // a is not the greatest double value less than 0.5 return (long)Math...