有人能给我解释一下它到底在说什么吗?我知道这基本上意味着它是单精度,具有 1 位符号、8 位指数和 23 位尾数。答案不应该是 2 * 2^8-2 * 2^23 吗?
编辑:2 * 2^8-2 * 2^23 是否确定所有 32 位 IEEE 浮点值
The finite positive floating-point numbers range from 2-149 (the smallest subnormal) to 2128-2104 (the number with the largest exponent for finite values and a significand of all one bits). We can group them into three categories:
- 小于 1 的值。其中零是整数。
- The values from 1 to 224-1. Some of these are integers, and some are not. However, every integer in this range is in the set of floating-point numbers, because they have at most 24 significant bits and are therefore representable with 24-bit significands. Therefore, the floating-point numbers have 224-1 integers in this interval.
- The values from 224 and up. All of these are integers, because the least significant position in their significands represents at least 1. This range contains all floating point numbers with exponents (of two) from 24 to 127 and every allowed significand. The significands are all those starting with “1.” and followed by any 23 bits, so there are 223 significands. Therefore, there are (127-24+1)•223 of these numbers.
The total for positive integers is 0 + 224-1 + (127-24+1)*223. The number of negative integers is the same, and 0 adds one more, so the grand total is 1,778,384,895.
(一旦我们找到了这个数字,它就会为我们提供一个搜索键来查找重复的问题。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)