如何将浮点数转换为二进制? [英] How to convert float number to Binary?

查看:21
本文介绍了如何将浮点数转换为二进制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何将这个浮点数: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

非常感谢任何帮助.谢谢

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆