Re: [fpc-pascal] Currency constant wrongly stored in generated EXE?

2014-05-14 Thread LacaK
Lets restate the hole thing, considering unit ncon.pas and pexpr.pas units in FPC 2.6.4 compiler. 1° It is not possible, without using some ad hoc adjustements, to have always an EXACT CURRENCY stored in a DOUBLE or EXTENDED because Double or Extended being expressed as Sign*2^exp*Base2(n).

Re: [fpc-pascal] Currency constant wrongly stored in generated EXE?

2014-05-13 Thread Bruno Krayenbuhl
Lets restate the hole thing, considering unit ncon.pas and pexpr.pas units in FPC 2.6.4 compiler. 1° It is not possible, without using some ad hoc adjustements, to have always an EXACT CURRENCY stored in a DOUBLE or EXTENDED because Double or Extended being expressed as Sign*2^exp*Base2(n).

Re: [fpc-pascal] Currency constant wrongly stored in generated EXE?

2014-05-12 Thread LacaK
You have troubled me seriously, so I have dug in the compiler source. :-) It appears that when parsing the source, Currency constants are cast to type BestReal (EXTENDED on I386) before being converted to the 8 byte currency written to the PPU or EXE or whatever is done. it was my

Re: [fpc-pascal] Currency constant wrongly stored in generated EXE?

2014-05-12 Thread Pierre Free Pascal
Did you check that infamous coprocessor Pentium FDIV bug? http://en.wikipedia.org/wiki/Pentium_FDIV_bug#Affected_models The even give values to test: The correct value is 4195835/3145727 = 1.333820449136241002 However, the value returned by the flawed Pentium is incorrect at or

Re: [fpc-pascal] Currency constant wrongly stored in generated EXE?

2014-05-12 Thread LacaK
Did you check that infamous coprocessor Pentium FDIV bug? http://en.wikipedia.org/wiki/Pentium_FDIV_bug#Affected_models The even give values to test: The correct value is 4195835/3145727 = 1.333820449136241002 However, the value returned by the flawed Pentium is incorrect at or

Re: [fpc-pascal] Currency constant wrongly stored in generated EXE ? was: Re: Inconsistent results currency - extended ?

2014-05-07 Thread LacaK
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

[fpc-pascal] Currency constant wrongly stored in generated EXE ? was: Re: Inconsistent results currency - extended ?

2014-05-06 Thread LacaK
Bruno Krayenbuhl wrote / napísal(a): 2 - Difference between 2.6.4 on Win98 and WinXP. I suspect that these 2 are on different computers and thus do not have exactly the same floating point unit. Yes Win 98 is on PC with Intel Pentium 4 CPU and Win XP on PC with Intel Core 2 Duo CPU But

Re: [fpc-pascal] Currency constant wrongly stored in generated EXE ? was: Re: Inconsistent results currency - extended ?

2014-05-06 Thread Bruno Krayenbuhl
My point N°2 regarding potential FPU difference was only concerning instruction line e:=c; = 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