| Author |
Message |
Red Dragon
Guest
|
Posted:
Sun Nov 06, 2005 1:15 am Post subject:
Where is my error? |
|
|
Can somebody explain to me why 1 in hexadecimal floating point is
3F800000?
My calculation is 7F800000
Here is my calculation.
1 = 1.0 x 2 power 0
Excess 127 is 1111111
Therefore floating number
in Binary is
0 111 1111 1000 000000000000.......
which is 7 F 8 00000 in Hex
Therefore 7F800000
Where is my mistake??
Thanks
Khoon. |
|
| Back to top |
|
 |
Red Dragon
Guest
|
Posted:
Sun Nov 06, 2005 9:15 am Post subject:
Re: Where is my error? |
|
|
| Quote: |
Your mistake is in that 127 contains 7 ones, but you wrote 8,
so your exponent is 255, or +128 after subtracting the bias.
Correct number:
0011 1111 1000 000000000...
^ ^
|exponent|
|
Now I see my mistake
Thank you very very much.
Regards,
Khoon.
.. |
|
| Back to top |
|
 |
Paul Pluzhnikov
Guest
|
Posted:
Sun Nov 06, 2005 9:15 am Post subject:
Re: Where is my error? |
|
|
"Red Dragon" <tskhoon@streamyx.com> writes:
| Quote: | 0 111 1111 1000 000000000000.......
which is 7 F 8 00000 in Hex
Therefore 7F800000
Where is my mistake??
|
Your mistake is in that 127 contains 7 ones, but you wrote 8,
so your exponent is 255, or +128 after subtracting the bias.
Correct number:
0011 1111 1000 000000000...
^ ^
|exponent|
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email. |
|
| Back to top |
|
 |
|
|
|
|