Extract double in binary file

Terry Reedy tjreedy at udel.edu
Thu Nov 27 19:00:03 CET 2003


"Pascal" <pascal.parent at free.fr> wrote in message
news:e567c03a.0311270107.9fc983d at posting.google.com...
> Some precisions:

('examples': 'precisions' does not work here in English)

> 0.00 > 00-00-00-00-00-00-7F-00
> 1.00 > 00-00-00-00-00-00-00-81
> 2.00 > 00-00-00-00-00-00-00-82
> 3.00 > 00-00-00-00-00-00-40-82
> 4.00 > 00-00-00-00-00-00-00-83
>
> 10.00 > 00-00-00-00-00-00-20-84
> 1000.00 > 00-00-00-00-00-00-7A-8A
>
> 1.11 > 14-AE-47-E1-7A-14-0E-81

The only obvious pattern I see is that 2**0 -> 81, 2**1->82, ...
2**9->8A (where A==10)  ie, for non-zero, last byte is 81 + exponent
of largest power of two, which seems like type of float, and first 6
are 0 if integral.  May be proprietary format.

TJR






More information about the Python-list mailing list