Why does Math.round (0.49999999999999994) return 1

摘要

In the following program you can see that each value slightly less than .5 is rounded down, except for 0.5. for (int i = 10; i >= 0; i--) { long l = Double.doubleToLongBits(i + 0.5); do...

欢迎在评论区写下你对这篇文章的看法。

评论

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.124.0. UTC+08:00, 2024-04-23 20:53
浙ICP备14020137号-1 $访客地图$