Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

converting binary to floating point?

807603Jan 26 2008 — edited Jan 26 2008
ok, i am programming a little java program at the consulter
the main idea of the program is to convert a decimal number to IEEE (floating point)
i am almost done except the exponent part
i dont understand the logic behind it
so, for example:
-6.625 = 110.101 (binary)
after normalization it will be -1.10101 * 2^2
so the IEEE will be
1 10000001 10101000000000000000000

i understand the sign part and the fraction part
but i have no idea how the exponent part came like this
the book say that 129-127=+2 so the exponent is 10000001
da, where it came from ???

i will appreciate it if someone explain this part for me step by step

thank you,

Edited by: abdoh2010 on Jan 26, 2008 2:37 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2008
Added on Jan 26 2008
1 comment
233 views