Calculations involving type Currency procuce wrong results
Original Reporter info from Mantis: Taleman
-
Reporter name: Tapio Lehtonen
Original Reporter info from Mantis: Taleman
- Reporter name: Tapio Lehtonen
Description:
The result is ten thousand times larger than it should be. Substituting variable of type Double procuces correct result. See attached example program.
program Project1;
(*Free Pascal 3.0.0 on Windows 7*)
var
K : Currency;
pros : Double;
F : Double;
result : Currency;
begin
K := 151542.5152;
pros := 10.0;
result := K * pros / 100;
writeln(result:10:2);
F := 151542.5152;
result := F * pros / 100;
writeln(result:10:2);
readln;
end.
Additional information:
Running same program on Debian Gnu/Linux 8.6 fpc version 2.6.4+dfsg-4 procus correct results. I think this bug is specific to Windows FPC version 3.0.0.
Mantis conversion info:
- Mantis ID: 30911
- OS: Windows
- OS Build: 7
- Platform: FPC 3.0.0 Lazarus 1.6
- Version: 3.0.0