View Issue Details

IDProjectCategoryView StatusLast Update
0033758FPCCompilerpublic2018-05-21 08:59
ReporterLacaKAssigned ToYuriy Sydorov 
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
PlatformWin64OSOS Version
Product Version3.0.4Product Build 
Target VersionFixed in Version 
Summary0033758: Currency bug on Win64 only
DescriptionSee Steps To Reproduce
Steps To Reproducevar
  c: currency;
  i1: int64;
  i2: int64 absolute c;

begin
  c := 68719476736;
  i1 := Trunc(c*10000);
  writeln(c,', ',i1,', ',i2);
  readln;
end.
Additional InformationWin32 (as expected): 6.871947673600000000E+10, 687194767360000, 687194767360000
Win64 (wrong) : 6.871947673600000000E+10, 53550614319 , 687194767360000
TagsNo tags attached.
Fixed in Revision
FPCOldBugId0
FPCTarget
Attached Files

Relationships

duplicate of 0033439 resolvedFlorian Multiply x Currency x Win64 
related to 0028748 resolvedYuriy Sydorov Adding Double to Currency - wrong result 
related to 0033755 closedMichael Van Canneyt Update ODBC header function due to problem on Win64 

Activities

Yuriy Sydorov

2018-05-18 15:24

manager   ~0108409

Last edited: 2018-05-18 16:02

View 2 revisions

It is expected result. The currency value overflows when multiplied by 10000 on all CPUs except i386 where the currency type is handled by FPU.
Add the {$Q+} directive and run your code. You will get the overflow error.

Cyrax

2018-05-18 15:54

reporter   ~0108411

FPC needs to add support for int128 type, then.

Yuriy Sydorov

2018-05-20 16:58

manager   ~0108447

Actually the bug is fixed in trunk. So this issue is duplicate of 0033439.

Issue History

Date Modified Username Field Change
2018-05-18 13:58 LacaK New Issue
2018-05-18 13:59 LacaK Relationship added related to 0033755
2018-05-18 14:46 LacaK Relationship added related to 0033439
2018-05-18 14:58 LacaK Relationship added related to 0028748
2018-05-18 15:24 Yuriy Sydorov Note Added: 0108409
2018-05-18 15:54 Cyrax Note Added: 0108411
2018-05-18 16:02 Yuriy Sydorov Note Edited: 0108409 View Revisions
2018-05-20 16:58 Yuriy Sydorov Note Added: 0108447
2018-05-20 16:58 Yuriy Sydorov Relationship replaced duplicate of 0033439
2018-05-20 16:58 Yuriy Sydorov Status new => resolved
2018-05-20 16:58 Yuriy Sydorov Resolution open => fixed
2018-05-20 16:58 Yuriy Sydorov Assigned To => Yuriy Sydorov
2018-05-21 08:59 LacaK Status resolved => closed