View Issue Details

IDProjectCategoryView StatusLast Update
0030911FPCCompilerpublic2016-11-11 13:19
ReporterTapio LehtonenAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionduplicate 
PlatformFPC 3.0.0 Lazarus 1.6OSWindowsOS Version7
Product Version3.0.0Product Build 
Target VersionFixed in Version 
Summary0030911: Calculations involving type Currency procuce wrong results
DescriptionThe 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 InformationRunning 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.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

duplicate of 0028748 resolvedYuriy Sydorov Adding Double to Currency - wrong result 

Activities

Tapio Lehtonen

2016-11-11 11:54

reporter  

Michael Van Canneyt

2016-11-11 12:02

administrator   ~0095761

This problem is fixed in trunk and the upcoming 3.0.2 release.

Issue History

Date Modified Username Field Change
2016-11-11 11:49 Tapio Lehtonen New Issue
2016-11-11 11:54 Tapio Lehtonen File Added: 45587370-Program-output.png
2016-11-11 12:02 Michael Van Canneyt Note Added: 0095761
2016-11-11 12:02 Michael Van Canneyt Status new => resolved
2016-11-11 12:02 Michael Van Canneyt Resolution open => fixed
2016-11-11 12:02 Michael Van Canneyt Assigned To => Michael Van Canneyt
2016-11-11 13:19 Jonas Maebe Relationship added duplicate of 0028748
2016-11-11 13:19 Jonas Maebe Resolution fixed => duplicate