reading 6-byte ("real48") Borland Pascal Floating Point numbers

Martin von Loewis loewis at informatik.hu-berlin.de
Fri Dec 14 05:52:07 EST 2001


nigel at pc714.maths.usyd.edu.au writes:

> From what I can see in RFC1014 (http://www.faqs.org/rfcs/rfc1014.html)
> the XDR and IEEE formats coincide for floating point. The real48 format
> (http://www.borland.com/techpubs/delphi/delphi5/oplg/memory.html)
> looks similar enough to IEEE that a bit of byte-shifting should do
> the conversion, and xdrlib.pack_double(data) gives you your number.

XDR (and thus xdrlib) support float (real32) and double (real64), so
it won't help for real48. They are all IEEE formats, but you have to
split the real48 into its fields yourself. pack won't help, either.

Regards,
Martin



More information about the Python-list mailing list