Reading a non-standard floating point format

Corey Coughlin corey.coughlin at attbi.com
Thu May 1 15:44:40 EDT 2003


Now wait a minute, sign bit, 8 bit mantissa in excess 128, that sounds
an awful lot like standard single precision IEEE format with two extra
bytes added to the mantissa.  Here's a thought, would it make sense to
read the value in a struct format of something like 'fBB', take the
resulting floating point number and then add on the bytes of extra
mantissa?  Then again, you'd probably need the exponent to renormalize
correctly.  It might be simpler to just drop the last two bytes if you
don't need the precision.  Actually, this is an awfully timely thread
for me, I just programmed a non-standard binary floating point format
for a GDS reading/writing object yesterday.




More information about the Python-list mailing list