Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于这种基于 IEEE 的浮点数表示格式,当舍入到偶数时,我对 2.0 + 3.0 = 4.0 的方式感到困惑。
http://imgur.com/1V69GrM
特别是最后一部分。倒数第二个也有点混乱。
我能解释一下吗?谢谢!
2.0 表示为 1.0 E 1 (1 * 2^1) (我在底数 2 中写尾数。)
3.0 表示为 1.1 E 1 (3/2 * 2^1)
将它们加在一起,你会得到一个未归一化的尾数 10.1,它被归一化为 1.01,指数变为 2^2。但是因为只有空间可以表示尾数的 1 个小数位,所以我们可以在尾数使用 1.0 和 1.1 之间进行选择,并且四舍五入表示我们选择“偶数”尾数,这使我们得到 1.0 E 2 (1 * 2^2,或 4.0)。