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

Dr. Rolf Jansen InstantWare at t-online.de
Sun Aug 15 10:04:45 CEST 2004

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.

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.

Best regards


__ InstantWare ______________________________________________________
  Dr. Rolf Jansen * Stephanienstra├če 19 * D-76133 Karlsruhe * Germany


More information about the fpc-pascal mailing list