[fpc-pascal]Re: How to convert between double and extended? (Mattias Gaertner)

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
Jansen) wrote:

> 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:
> http://developer.apple.com/documentation/mac/PPCNumerics/PPCNumerics 
> -18.html
> which is part of a comprehensive description of the PPC Numerics in  
> Apples documentation:
>    http://developer.apple.com/documentation/mac/pdf/PPC_Numerics.sit.hqx
> A more generic description of the PowerPC can be found here:
> http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/ 
> 852569B20050FF778525699600719DF2/$file/6xx_pem.pdf
> 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 mailing list