[fpc-pascal]Re: How to convert between double and extended? (Mattias Gaertner)
nc-gaertnma at netcologne.de
Sun Aug 15 11:42:06 CEST 2004
On Sun, 15 Aug 2004 10:04:45 +0200 InstantWare at t-online.de (Dr. Rolf
> On Sun, 15 Aug 2004 03:03:08 +0200 Mattias Gaertner wrote:
> > Where can I get information about the i386 extended and the ppc double
> > format? Is it correct, that the ppc double is simply a reversed i386
> > double?
> I don´t know about the i386 format. In the past I did extended
> conversions between i386 and M68k. It was simply done by reversing the
> ten bytes. So, I assume that the the same holds for double conversion
> between i386 and PPC too, since the double format of PPC and M68k is
> exactly the same.
> For PowerPC you find a description of the format at the following page:
> which is part of a comprehensive description of the PPC Numerics in
> Apples documentation:
> A more generic description of the PowerPC can be found here:
> You will find the desired information at page 110.
Thanks for the hints. That helped.
> I suggest to reverse the byte at the PPC side, and to "stream" the
> doubles to the i386 box, and to assign the double there to an extended
> variable. In this case there is no need for a special conversion
> routine between double and extended since this is handled by the math
> co-processor automatically.
The problem is a binary stream format coming from the i386 object pascal
world, using extended and single, but no doubles. So I must be able to
create and read i386 10 bytes extended. It's ok to loose some precision.
More information about the fpc-pascal