[fpc-pascal]How to convert between double and extended?

Florian Klaempfl F.Klaempfl at gmx.de
Sun Aug 15 10:52:49 CEST 2004


Mattias Gaertner wrote:

> On Sun, 15 Aug 2004 00:11:16 +0200  Jonas Maebe <jonas at zeus.ugent.be> wrote:
> 
> 
>>On 14 aug 2004, at 19:34, Mattias Gaertner wrote:
>>
>>
>>>How can I convert between PowerPC double and i386 Extended on a 
>>>powerpc?
>>>For example: I want to save a Double under powerpc to a stream as i386
>>>Extended and read it under i386 as Extended.
>>>
>>>Are there already some conversion functions to convert between the 
>>>various
>>>floating point formats?
>>
>>No, only a function to convert a TP real to double (real2double). Also, 
>>on the ppc extended is defined as double (for source code 
>>compatibility), so we'll have to use a record or so.
> 
> 
> That's why I asked.
> 
> 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?

Yes. rtl/inc/real2str.inc around 260 shows how to split the different 
float types.

> 
> 
> Mattias
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list