<html><body><div>Thank you very much for your effort!</div><div>Yes I compile with same version FPC 2.6.4, but important point is, that on *Windows 98*!</div><div><br></div><div>When I compile on Windows XP, I get same results as you for 2.6.4:</div><div><div>CW=4978</div><div>currency=-9.223372036854775808E+14</div><div>currency=-9.223372036854799990E+13</div><div>extended=-9.2233720368547758E+0014</div><div>string=-92233720368547,9999</div><div>int64=-9223372036854775808</div><div>double=-9.22337203685480E+017</div></div><div><br></div><div>But slightly different for 2.7.1 (on same PC):</div><div><div>CW=4978</div><div>currency=-9.223372036854775808E+14</div><div>currency=-9.223372036854799990E+13</div><div>extended=-9.22337203685477580811E+0014 <== HERE</div><div>string=-92233720368547,9999</div><div>int64=-9223372036854775808</div><div>double=-9.2233720368547994E+017 <== AND HERE</div></div><div>(which does not must indicate error, because there is
no exact floating point representation of given currency value)</div><div><br></div><div><kraybruno@bluewin.ch>But my original question is why are different results for WinXP and Win98 with same compiler FPC 2.6.4 ?</kraybruno@bluewin.ch></div><div><kraybruno@bluewin.ch>It seems, that FPC on Win98 incorrectly stores currency constant in generated EXE file, so varible "c" is initialised with wrong value ...</kraybruno@bluewin.ch></div><div>(see my first email with results)</div><div><br></div><div><kraybruno@bluewin.ch>Thanks</kraybruno@bluewin.ch></div><div><kraybruno@bluewin.ch>-Laco.</kraybruno@bluewin.ch></div><div><kraybruno@bluewin.ch><br>> Tested with FPC 2.6.4 .<br>> <br>> LacaK are you sure you compile with the same version.<br>> <br>> To me everything looks fine.<br>> <br>> program test_Currency;<br>> <br>> {$mode objfpc}{$H+}<br>> <br>> uses<br>> {$IFDEF UNIX}{$IFDEF UseCThreads}<br>> cthreads,<br>> {$ENDIF}{$ENDIF}<br>
> SysUtils;<br>> <br>> var<br>> s: string;<br>> c: currency;<br>> e: extended;<br>> d: double;<br>> i64: int64;<br>> <br>> begin<br>> i64:=1 shl 63;<br>> c:=PCurrency(@i64)^; // Minimum representable currency<br>> d:=-922337203685479999;<br>> e:=c;<br>> i64:=PInt64(@c)^;<br>> <br>> writeln('CW=', Get8087cw());<br>> writeln('currency=', c);<br>> c:=-92233720368547.9999; // LacaK currency<br>> writeln('currency=', c);<br>> writeln('extended=', e);<br>> writeln('string=', currtostr(c));<br>> writeln('int64=', i64);<br>> writeln('double=', d);<br>> readln;<br>> end.<br>> <br>> Gives me :<br>> CW=4978<br>> currency=-9.223372036854775808E+14 -> Ok to me<br>> currency=-9.223372036854799990E+13 -> Ok to me<br>> extended=-9.2233720368547758E+0014<br>> string=-92233720368547.9999 -> Ok to me<br>> int64=-9223372036854775808<br>> double=-9.22337203685480E
+017<br>> <br>> BrunoK<br>> <br>> _______________________________________________<br>> fpc-pascal maillist - fpc-pascal@lists.freepascal.org<br>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal<br>-Laco.</kraybruno@bluewin.ch></div><br></body></html>