jzzc 发表于 2020-2-4 13:51:09

浮点数的转换问题关于

https://fishc.com.cn/forum.php?mod=image&aid=119753&size=300x300&key=c64ac262996c8f07&nocache=yes&type=fixnone
这道题只看D选项就好了,把这4字节作为浮点数转换为10进制。
我的理解:
按照浮点数的转换规则,这32位二进制可以拆分为 0 11001110 11011000110111101100010;
那么指数部分就是 (11001110转换为10进制后) - 127 = 79;
尾数部分为 1.(二进制)1101100011011110110001;
所以这个数怎么也不会是答案D中的数字(指数部分差距很大)

请问是不是我的理解哪里出问题了?如果是,还请帮忙指点一下,不胜感激。{:5_100:}

人造人 发表于 2020-2-4 14:26:32

https://www.cnblogs.com/wuyuan2011woaini/p/4105765.html

人造人 发表于 2020-2-4 15:03:56

怎么样?上面那篇文章看过了吗?
下面的计算步骤就是参考了上面那篇文章

不知道你能不能看懂,如果哪里不懂就再问我
0110 0111 0110 1100 0110 1111 0110 0010

01100111011011000110111101100010

0 11001110 11011000110111101100010

1.11011000110111101100010 * 2^(206-127)

1.11011000110111101100010 * 2^79

0       1.00000000000000000000000000000000000000000000000000
1       0.50000000000000000000000000000000000000000000000000
2       0.25000000000000000000000000000000000000000000000000
3       0.12500000000000000000000000000000000000000000000000
4       0.06250000000000000000000000000000000000000000000000
5       0.03125000000000000000000000000000000000000000000000
6       0.01562500000000000000000000000000000000000000000000
7       0.00781250000000000000000000000000000000000000000000
8       0.00390625000000000000000000000000000000000000000000
9       0.00195312500000000000000000000000000000000000000000
10      0.00097656250000000000000000000000000000000000000000
11      0.00048828125000000000000000000000000000000000000000
12      0.00024414062500000000000000000000000000000000000000
13      0.00012207031250000000000000000000000000000000000000
14      0.00006103515625000000000000000000000000000000000000
15      0.00003051757812500000000000000000000000000000000000
16      0.00001525878906250000000000000000000000000000000000
17      0.00000762939453125000000000000000000000000000000000
18      0.00000381469726562500000000000000000000000000000000
19      0.00000190734863281250000000000000000000000000000000
20      0.00000095367431640625000000000000000000000000000000
21      0.00000047683715820312500000000000000000000000000000
22      0.00000023841857910156250000000000000000000000000000
23      0.00000011920928955078125000000000000000000000000000
24      0.00000005960464477539062500000000000000000000000000

(1 + 0.5 + 0.25 + 0.0625 + 0.03125 + 0.001953125 + 0.0009765625 + 0.000244140625 + 0.0001220703125 \
+ 0.00006103515625 + 0.000030517578125 + 0.00000762939453125 + 0.000003814697265625 + 0.0000002384185791015625) * 2^79



1.8471491336822509765625 * 2^79

1116533140193633747599360

1.116533140193633747599360 * 10^24

jzzc 发表于 2020-2-4 16:41:25

人造人 发表于 2020-2-4 15:03
怎么样?上面那篇文章看过了吗?
下面的计算步骤就是参考了上面那篇文章



谢谢人造人!!!,我晓得我哪里理解错了,你的解答非常详细!!!我也跟着算了一遍,没有问题,
比心 {:5_109:}
页: [1]
查看完整版本: 浮点数的转换问题关于