Calculation error

I think it was already discussed in the past but I couldn’t find it and the problem still exists in the SVN version (using D7):
These two lines give a different result:

var f, d: double;

f := 1.0; d := 2.0; f := f + d; // 3 -> Good
f := 1.0; d := 2.0; f := d + f; // 4 -> Bad

Is there a workaround?

Paulo Costa

Hello,
We couldn’t reproduce this error. What version do you use?
Our testcase:

program Test;

var f, d: double;
begin
f := 1.0; d := 2.0; f := f + d; // 3 -> Good
writeln(Floattostr(f));
f := 1.0; d := 2.0; f := d + f; // 4 -> Bad
writeln(Floattostr(f));
end.

Solved.

The old version was rev 110. I removed it and installed rev 261 before posting.
The problem was that I did not purge the old version and while the new one was the installed one, the dcus from rev 110 where still on the Library Path :frowning:

Thanks to your answer I purged completely the old version and pointed the Library Path to the new one.
Now the calculation is OK.

(Why did I put the new version in another folder? Rev 110 was so old that it pointed to an outdated repository :frowning: )

Thanks and sorry for the noise,

Paulo Costa