Number of numbers between 2 and 3 in IEEE-754

﹥>﹥吖頭↗ 提交于 2019-12-13 03:55:16

问题


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.


回答1:


Using a handy online IEEE-754 conversion utility:

2.0 = 0x40000000
3.0 = 0x40400000

So:

0x40400000 - 0x40000000 = 0x400000 = 4194304

Answer: 4 million or so.



来源:https://stackoverflow.com/questions/28427987/number-of-numbers-between-2-and-3-in-ieee-754

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!