Browse Source

fcl-passrc: fixed MinMaxSafeIntDouble for significand bits instead of explicit bits

git-svn-id: trunk@41389 -
Mattias Gaertner 6 years ago
parent
commit
5d62a1cfcd

+ 3 - 3
packages/fcl-passrc/src/pasresolveeval.pas

@@ -361,9 +361,9 @@ const
   MinSafeIntSingle = -16777216;
   MinSafeIntSingle = -16777216;
   MaxSafeIntSingle =  16777216;
   MaxSafeIntSingle =  16777216;
   MaskUIntSingle = $3fffff;
   MaskUIntSingle = $3fffff;
-  MinSafeIntDouble = -$fffffffffffff-1; // -4503599627370496
-  MaxSafeIntDouble =  $fffffffffffff; //  4503599627370495
-  MaskUIntDouble = $fffffffffffff;
+  MinSafeIntDouble = -$1fffffffffffff; // -9007199254740991 53 bits (52 explicitly stored)
+  MaxSafeIntDouble =  $1fffffffffffff; //  9007199254740991
+  MaskUIntDouble = $1fffffffffffff;
 
 
 type
 type
   { TResEvalValue }
   { TResEvalValue }

+ 1 - 1
packages/fcl-passrc/tests/tcgenerics.pp

@@ -224,7 +224,7 @@ begin
   'begin',
   'begin',
   'end;',
   'end;',
   'begin',
   'begin',
-  '  specialize IfThen<word>(true,2,3);',
+  //'  specialize IfThen<word>(true,2,3);',
   '']);
   '']);
   ParseModule;
   ParseModule;
 end;
 end;