Binary representation of floating point numbers

63q2o4i02 at sneakemail.com 63q2o4i02 at sneakemail.com
Tue Dec 6 17:37:31 EST 2005


Ok, I figured it out...

The only way to get the flags is as a float, either through an ascii
string or a true float.  The value of the float, however, is
representable as 24 bits of normal binary.

So for example, the value returned is +4.608400E+04
which is really an int, 46084, which is more easily convertible to
binary.

So the question becomes how to convert an int to binary, which I found
here
http://groups.google.com/group/comp.lang.python/browse_frm/thread/300e220394e2d841/33bc9b0d8174b038?lnk=st&q=python+int+to+binary&rnum=1#33bc9b0d8174b038

So problem solved (just need to implement it).

Michael




More information about the Python-list mailing list