java - Why does Math.round(0.49999999999999994) return 1 ...

java - Why does Math.round(0.49999999999999994) return 1 ...

瀏覽:1040
日期:2025-04-27
Summary. In Java 6 (and presumably earlier), round(x) is implemented as floor(x +0.5) .1 This is a specification bug, for precisely this one pathological ......看更多