IEEE 浮点格式中的隐含位

发布于 2024-12-22 00:07:30 字数 152 浏览 3 评论 0原文

为什么 IEEE 浮点格式中有隐含(或隐藏)位?其目的是什么? 维基百科中提到了这一点。

Why is there an implied (or hidden) bit in IEEE floating point format? What is the purpose of it? It is mentioned in passing on Wikipedia.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陈独秀 2024-12-29 00:07:30

来自了解 IEEE 浮点错误的(完整)教程

“[Fraction] 是数字的归一化小数部分,归一化是因为调整了指数,以便前导位始终为 1。这样,就不必存储它,并且您会多获得一位这就是为什么有一个隐含位。”

它基本上允许更高的精度。

From (Complete) Tutorial to Understand IEEE Floating-Point Errors:

"[Fraction] is the normalized fractional part of the number, normalized because the exponent is adjusted so that the leading bit is always a 1. This way, it does not have to be stored, and you get one more bit of precision. This is why there is an implied bit."

It basically allows for higher precision.

如此安好 2024-12-29 00:07:30

我认为最重要的是要知道它实际上并未存储在内存中:

假定该格式具有值为 1 的隐式前导位,除非指数字段存储为全零。因此,只有 10 位有效数出现在内存格式中,但总精度为 11 位。

例如,在半精度浮点(16 位或 2 个字节,又名FP16)中,有 1 个符号位、5 个指数位和 10 个实际有效数字位。 1 + 5 + 10 = 16,然后隐含的一个额外有效位始终为 == 1

IEEE 浮点格式的隐含位

I suppose that the most important thing to know is that it is not actually stored in memory:

The format is assumed to have an implicit lead bit with value 1 unless the exponent field is stored with all zeros. Thus, only 10 bits of the significand appear in the memory format but the total precision is 11 bits.

So for instance in the half-precision floating point (16 bits, or 2 bytes, aka. FP16), there are 1 sign bit, 5 exponent bits, and 10 actual significand bits. 1 + 5 + 10 = 16, and then there's the implied one extra significand bit that's always == 1.

Implied bit in IEEE floating point format

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文