Bruno Krayenbuhl  wrote / napĂ­sal(a):
I have absolutely no idea of how the compiler does translate Currency constant to code, sorry.

May be it uses the FPU when translating from String representation to assembler value, but I have absolutely no idea where that would be done in the compiler. Anyway, it may be possible that the compiler uses StrToCurr or something similar. var cAsString:string;
.
.
cAsString:=CurrToStr(c);
c:=StrToCurr(cAsString). { <== Check after here on W98 / XP and look for differences on value c. That uses an FPU instruction fistpll that look as causing
For :
 c:=strtocurr('92233720368547');
 writeln(c); // here I get CORRECT result: 9.223372036854700000E+13

But as I wrote:
 c:=92233720368547;
 writeln(c);  // here I get INCORRECT result: 9.223372036854699520E+13

But as I wrote it is not a problem of displaying currency value, it is problem that currency variable realy contains incorrect number, which is then correctly displayed ... ;-(

-Laco.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to