Board index » delphi » FPC and real data type

FPC and real data type

Hi!

I'd like to port TP7 code to FreePascal and I'm having a problem with the real
data type:
In TP7 the real data type has a size of 6 bytes where the FPC real type is 8
bytes. Unfortunately I have to read the real numbers out of a (old) file so the
size really matters.

Does anybody know a solution?
Maybe there's a compiler switch in FPC which I haven't discovered yet.

  Guido

 

Re:FPC and real data type


Quote
In article <3955D1C4.50B65...@gmx.net>, gus <gusm...@gmx.net> wrote:
> I'd like to port TP7 code to FreePascal and I'm having a problem with the real
> data type:
> In TP7 the real data type has a size of 6 bytes where the FPC real type is 8
> bytes. Unfortunately I have to read the real numbers out of a (old) file so
> the size really matters.
> Does anybody know a solution?

The best you can do is to write a translation program (read the
datafile, convert the reals to single/double/extended and write
everything to a new file). The 6 byte real type is not supported in
FPC.

The conversion can be done in TP (simpy assign the real values to a
variable of the type single/double/extended), or you can use an FPC
program and do the conversion manually (see
<http://lists.freepascal.org/pipermail/fpc-pascal/2000-June/005893.html>
 and
<http://lists.freepascal.org/pipermail/fpc-devel/2000-June/003958.html>
for conversions to respectively single and double)

Jonas

Other Threads