如何浮点数转换为二进制? [英] How to convert float number to Binary?
本文介绍了如何浮点数转换为二进制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉我怎样才能转换该浮点数:12.25为二进制?
我知道如何转换的12,而不是0.25
Can anyone please tell me how can I convert this float number: 12.25 to binary? I know how to convert the "12" but not the 0.25
任何帮助很多AP preciated。
谢谢
Any help is much appreciated. Thanks
推荐答案
请按2小数点后数乘以直至变为1.0:
Keep multiplying the number after decimal by 2 till it becomes 1.0:
0.25*2 = 0.50
0.50*2 = 1.00
和的结果是相反的顺序为0.01
and the result is in reverse order being .01
这篇关于如何浮点数转换为二进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文