[英]Maximum and minimum exponents in double-precision floating-point format
According to the IEEE Std 754-2008 standard, the exponent field width of the binary64 double-precision floating-point format is 11 bits, which is compensated by an exponent bias of 1023. The standard also specifies that the maximum exponent is 1023, and the minimum is -1022.根据IEEE Std 754-2008标准,binary64 双精度浮点格式的指数字段宽度为 11 位,由 1023 的指数偏差补偿。该标准还规定最大指数为 1023,并且最小值为 -1022。 Why is the maximum exponent not:
为什么最大指数不是:
2^10 + 2^9 + 2^8 + 2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 - 1023 = 1024
And the minimum exponent not:而最小指数不是:
0 - 1023 = -1023
The bits for the exponent have two reserved values, one for encoding 0
and subnormal numbers, and one for encoding ∞ and NaNs.指数的位有两个保留值,一个用于编码
0
和次正规数,另一个用于编码 ∞ 和 NaN。 As a result of this, the range of normal exponents is two smaller than you would otherwise expect.因此,正常指数的范围比您预期的要小 2。 See §3.4 of the IEEE-754 standard (
w
is the number of bits in the exponent — 11
in the case of binary64
):见§3.4的IEEE-754标准的(
w
是比特的指数的数量- 11
中的情况下binary64
):
The range of the encoding's biased exponent E shall include:
编码的偏置指数 E 的范围应包括:
― Every integer between 1 and 2 w – 2, inclusive, to encode normal numbers
― 1 到 2 w – 2(含)之间的每个整数,用于编码正常数
― The reserved value 0 to encode ±0 and subnormal numbers
― 保留值 0 用于编码 ±0 和次正规数
― The reserved value 2 w – 1 to encode ±∞ and NaNs.
― 保留值 2 w – 1 用于编码 ±∞ 和 NaN。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.