Reading a non-standard floating point format

John Machin sjmachin at lexicon.net
Sun Apr 27 03:23:05 EDT 2003


bokr at oz.net (Bengt Richter) wrote in message news:<b8fd9r$6fo$0 at 216.39.172.122>...
> On Sat, 26 Apr 2003 19:41:43 -0400, "Tim Peters" <tim_one at email.msn.com> wrote:
> [...]
> >There's no way to guess without examples, though.  If you can, show us the
> >48-bit byte strings for these numbers:
> >
> >    0.0
> >    1.0
> >    1.25
> >    2.9e-39
> >    1.7e38
> >
> >That should be enough to fill in the missing pieces.
> >
> Maybe include
>     -1.25
> also?
> And can minus zero be generated?
> Are numbers sign/magnitude or?
> 

I would ask for 1.125 as well as 1.25 (to be sure of bit order within
a byte[*]) and also 1.03125 (1+1/32, 8 bits onwards from 1.25) to be
sure of byte order within the 48-bit stucture.

The OP might also consider posting on alt.sys.alpha-micro -- surely
somebody there will be able to provide better docs than the quoted
excerpt from the AlphaBasic manual. You could ask about access to the
AMs that are still running -- it could be very handy to mount a
"chosen-plaintext" attack on the problem i.e. write an AlphaBasic
program which wrote various chosen f.p. numbers to a "random access"
(i.e. binary file) then ogle it with the aid of a hex dumper.

* ... bit order within a byte: don't laugh, we're in 1980s
microcomputer territory here; no f. p. h/ware, all done in ASM by
heavy bit-bashing. I recall different variants of "standard" 32-bit
CRCs -- the variants arising from whether the bits were shifted in
from the left/right/high-end/low-end/east/west/...

Hope this helps,
John




More information about the Python-list mailing list