Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
336 views
Welcome To Ask or Share your Answers For Others

1 Answer

Using a handy online IEEE-754 conversion utility:

2.0 = 0x40000000
3.0 = 0x40400000

So:

0x40400000 - 0x40000000 = 0x400000 = 4194304

Answer: 4 million or so.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...