IEEE-754中2到3之间的数字数量 [英] Number of numbers between 2 and 3 in IEEE-754

查看:123
本文介绍了IEEE-754中2到3之间的数字数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习IEEE-754的数字表示形式.我知道如何从二进制转换为IEEE,反之亦然.现在,我尝试找出如何找出单精度的数字,例如2到3之间的数字.因此,两者的符号都相同.我认为分数将是一个组合,并且指数取决于适当的数字(因为移位).这样做会是一个聪明的方法吗?我将不胜感激.

解决方案

使用方便在线IEEE-754转换实用程序:

2.0 = 0x40000000
3.0 = 0x40400000

所以:

0x40400000 - 0x40000000 = 0x400000 = 4194304

答案:400万左右.

i am learning IEEE-754 representation of numbers. I know how to convert from binary to IEEE and on vice versa. Now i am trying to figure out how to find out how many numbers in single precision are for instance between 2 and 3. So, the sign will be the same for both. Fraction will be a combination i think and exponent is dependent from a proper number(because of shifts). WHat would be a clever way to do it right ? I would be grateful for any help.

解决方案

Using a handy online IEEE-754 conversion utility:

2.0 = 0x40000000
3.0 = 0x40400000

So:

0x40400000 - 0x40000000 = 0x400000 = 4194304

Answer: 4 million or so.

这篇关于IEEE-754中2到3之间的数字数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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