algorithm - 为什么标准化数字的最高有效位总是 1?

标签 algorithm floating-point exponent mantissa

来自 Significand entry in Wikipedia :

When working in binary, the significand is characterized by its width in binary digits (bits). Because the most significant bit is always 1 for a normalized number, this bit is not typically stored and is called the "hidden bit". Depending on the context, the hidden bit may or may not be counted towards the width of the significand. For example, the same IEEE 754 double precision format is commonly described as having either a 53-bit significand, including the hidden bit, or a 52-bit significand, not including the hidden bit. The notion of a hidden bit only applies to binary representations. IEEE 754 defines the precision, p, to be the number of digits in the significand, including any implicit leading bit (e.g. precision, p, of double precision format is 53).

为什么标准化数字的最高有效位总是 1?有人可以举例说明吗?

最佳答案

二进制中仅有的数字是 0 和 1,前导零不重要(例如 1101 与 00001101 相同,额外的零无任何意义)。因此,最高有效数字必须是 1,因为这是唯一的其他可能性。

因为您知道最高有效位必须是 1,所以您可以忽略它而不会丢失任何信息。这很有用,因为它可以让您获得额外的精度。

数字 0 是个异常(exception),但这是通过将偏置指数设置为 0 以 float (以及其他特殊情况,如 NaN 和 +/- 无穷大)处理的。

关于algorithm - 为什么标准化数字的最高有效位总是 1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12038750/

相关文章:

java - 关于数组问题(查找重复项)的问题

ruby - 不同 ruby​​ 版本的不同指数行为

c# - 计算平方根和幂的快速方法?

c++ - 具有非常大指数的 GMP mpz_pow_ui

algorithm - DAG 路径乘积之和

c# - 如何在 C# 中将一组字符串分成它们的组成字符?

algorithm - BigO 绑定(bind)在一些伪代码上

C++ 函数返回 'inf' 而不是 double

python - 表示 float 的字符串

C语言编程 printf、scanf