Browse Source

troundm: fixed 32bit rmNearest tests and wrong result values

git-svn-id: trunk@36522 -
Károly Balogh 8 years ago
parent
commit
8a6c995b75
1 changed files with 6 additions and 5 deletions
  1. 6 5
      tests/test/units/math/troundm.pp

+ 6 - 5
tests/test/units/math/troundm.pp

@@ -18,14 +18,14 @@ const
   );
   );
 
 
   res2_single: TExpected = (
   res2_single: TExpected = (
-    $4EFFFFFF,
+    $4F000000,
     $4EFFFFFF,
     $4EFFFFFF,
     $4F000000,
     $4F000000,
     $4EFFFFFF
     $4EFFFFFF
   );
   );
 
 
   res3_single: TExpected = (
   res3_single: TExpected = (
-    $CEFFFFFF,
+    $CF000000,
     $CF000000,
     $CF000000,
     $CEFFFFFF,
     $CEFFFFFF,
     $CEFFFFFF
     $CEFFFFFF
@@ -69,6 +69,7 @@ var
   yd: longword absolute y;
   yd: longword absolute y;
 begin
 begin
   writeln('integer value=',hexstr(x,8));
   writeln('integer value=',hexstr(x,8));
+  setroundmode(rmNearest);
   y:=x;
   y:=x;
   writeln('rmNearest  ',y, ' ',hexstr(yd,8));
   writeln('rmNearest  ',y, ' ',hexstr(yd,8));
   if yd<>res[rmNearest] then fail;
   if yd<>res[rmNearest] then fail;
@@ -100,17 +101,17 @@ begin
   y:=x;
   y:=x;
   writeln('rmNearest  ',y, ' ',hexstr(yq,16));
   writeln('rmNearest  ',y, ' ',hexstr(yq,16));
   if yq<>res[rmNearest] then fail;
   if yq<>res[rmNearest] then fail;
-  
+
   setroundmode(rmUp);
   setroundmode(rmUp);
   y:=x; 
   y:=x; 
   writeln('rmUp       ',y, ' ',hexstr(yq,16));
   writeln('rmUp       ',y, ' ',hexstr(yq,16));
   if yq<>res[rmUp] then fail;
   if yq<>res[rmUp] then fail;
-  
+
   setroundmode(rmDown);
   setroundmode(rmDown);
   y:=x;
   y:=x;
   writeln('rmDown     ',y, ' ',hexstr(yq,16));
   writeln('rmDown     ',y, ' ',hexstr(yq,16));
   if yq<>res[rmDown] then fail;
   if yq<>res[rmDown] then fail;
-  
+
   setroundmode(rmTruncate);
   setroundmode(rmTruncate);
   y:=x;
   y:=x;
   writeln('rmTruncate ',y, ' ',hexstr(yq,16));
   writeln('rmTruncate ',y, ' ',hexstr(yq,16));