Browse Source

* fixed mantis #9695 introduced by the fix in r7959

git-svn-id: trunk@8494 -
Jonas Maebe 18 years ago
parent
commit
4f23f216f6
3 changed files with 11 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      rtl/inc/real2str.inc
  3. 9 0
      tests/webtbs/tw9695.pp

+ 1 - 0
.gitattributes

@@ -8426,6 +8426,7 @@ tests/webtbs/tw9347b.pp svneol=native#text/plain
 tests/webtbs/tw9384.pp svneol=native#text/plain
 tests/webtbs/tw9385.pp svneol=native#text/plain
 tests/webtbs/tw9672.pp svneol=native#text/plain
+tests/webtbs/tw9695.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 1 - 1
rtl/inc/real2str.inc

@@ -383,7 +383,7 @@ begin
           if int(d+roundCorr) = 1 then
             begin
               roundStr(temp,spos);
-              d := frac(d);
+              d := frac(d+roundCorr);
               if (f < 0) then
                 dec(currprec);
             end;

+ 9 - 0
tests/webtbs/tw9695.pp

@@ -0,0 +1,9 @@
+var
+  s: string;
+  d: Double;
+begin
+  d := 5.9999999999999991;
+  Str(d:23,s); 
+  if (pos('9',s)<>0) or (pos('5',s)<>0) then
+    halt(1);
+end.