Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Base2 Floating Points to Binary. Any Info?

Author
Message
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 24th Jan 2005 09:34
Does anyone know a good site that fully explains and shows how floats are handled in computers? I did a google search and it turned up alot of sites talking about it but none of it seems to compute to me. This is what I have found.

Base2 Floating Points (I am assuming this is what DBP uses)

Single Float
Bits: 0-22 = mantissa, 23-30 = exponent, 31 = sign bit

Double Float
Bits: 0-51 = mantissa, 52-62 = exponent, 63 = sign bit

The mantissa of both are calculated using sign magnitude method (I would have though two's compliment would be faster but oh well).

This sounds like it makes alot of sense but some of the float values I get don't seem to follow this. Can anyone post a link to a site that actually shows the binary representaion of some float numbers?

I have also found that Double and Sngle floats take the same number of cycles to calculate in P4's so the only reason not use doubles is the double memory usage.

I also understand that different processors store and calculate floats differently. This may be what is throwing my calculations off.

Any help would be greatly appreciated.

Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 24th Jan 2005 09:54 Edited at: 24th Jan 2005 09:56
if google dosent work yahoo does

http://www3.wittenberg.edu/bshelburne/Comp150/BinaryNumbers.htm

scroll down a little and its all about it with some diagrams

p.s. thanks again for helping me a while back

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 24th Jan 2005 10:04
Quote: "if google dosent work yahoo does

http://www3.wittenberg.edu/bshelburne/Comp150/BinaryNumbers.htm

scroll down a little and its all about it with some diagrams "


Thanks This is what I was looking for.

Quote: "p.s. thanks again for helping me a while back"


Glad I could help. And now you have helped me. Thats why I help people whenever I can.

Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 24th Jan 2005 10:10 Edited at: 24th Jan 2005 10:17
if i may ask what are ya gonna use this for?

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 24th Jan 2005 11:00
Top sectret project

Nah I just like to know whats going on in my computer. I am thinking of using my own floating method to get away from the precision errors but the range of values will differ (be alot less range) and it will be alot slower as well. Just messing around trying to learn a bit more really.

It bothers me not knowing how stuff like this works. But now I know I can convert decimal numbers to single and double precision binary now. Thanks.

Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 24th Jan 2005 12:04
sometimes i like to go around [href]www.howstuffworks.com[/href] lol i learn alot

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 24th Jan 2005 17:35 Edited at: 24th Jan 2005 17:38
Yeah I used to go there but pop-ups are like crazy on that site for me. My little popup blocker sounds like I'm making popcorn all the time there. I haven't been in a while though. I'll check it out again.

[edit] Still a few popups but its alot better now

Login to post a reply

Server time is: 2024-11-13 19:03:31
Your offset time is: 2024-11-13 19:03:31