<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.23588">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Lacak :</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>1 - XP difference between 2.6.4 and 2.7.1 on same
machine</FONT></DIV>
<DIV><FONT size=2 face=Arial> writeln('extended=',
e); </FONT></DIV>
<DIV><FONT size=2 face=Arial> <FONT size=3
face="Times New Roman">extended=-9.22337203685477580811E+0014 <== HERE
</FONT></FONT></DIV>
<DIV> calls str_real in real2str.inc that is
in the course of beeing modified in 2.7.1. If your compare the source code, you
will see it has changed and is in fact work in progress, at least in my OLD
downloaded version of FPC2.7.1.</DIV>
<DIV>If it is still like that with the latest developpment 2.7.1, maybe some
knowlegable developper should have a look at it.</DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV>
<DIV><FONT size=2 face=Arial>2 - Difference between 2.6.4 on Win98
and WinXP. </FONT></DIV>
<DIV><FONT size=2 face=Arial> I suspect that these 2 are
on different computers and thus do not have exactly the same floating point
unit. Line</FONT></DIV>
<DIV><FONT size=2 face=Arial> e:=c; uses the FPU to convert from Currency
to Extended. Schematically, Extended stores values Sign*2^exponent*Mantissa.
(See <A
href="http://en.wikipedia.org/wiki/Extended_precision">http://en.wikipedia.org/wiki/Extended_precision</A> for
more info) That means, for example, that 0.1 cannot be EXACTLY stored in an
Extended thus, depending on the FPU, they might be converted to a slightly
different representation.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>2b - <FONT size=3 face="Times New Roman">Quote
: It seems, that FPC on Win98 incorrectly stores currency
constant.</FONT></FONT></DIV>
<DIV> No. And the proof is that :</DIV>
<DIV> writeln('currency=',
c);<BR> writeln('string=', currtostr(c));</DIV>
<DIV> do actualy writeln the correct result. Both use at some point
currtostr(c). What currtostr(c) does is expand the Int64(c) to a decimal string
and then insert the point in the position(length-4).</DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>As long as there are no divisions and no Overflow,
Currency will give correct and exact decimal results in all +, -,* computations,
it is a simple Int64 that is converted (see 2b) to a decimal representation when
displayed. I have used </FONT><FONT size=2 face=Arial>Currency in Quick Basic
Compiler in the old days, then in Delphi applications for accounting purposes
(with some customized roundings / convertions to Float when needed) and never
had complaints from users.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Regards, Bruno</FONT></DIV></DIV></BODY></HTML>