java - Why does Math.round(0.49999999999999994) return 1 - Stack Overflow
In the following program you can see that for each value slightly less that .5 is rounded down, except for 0.5. for (int i = 10; i >= 0; i--) { long l = Double.doubleToLongBits(i + 0.5); ... Summary In Java 6 (and presumably earlier), round(x) is implemen...