Ver código fonte

* fixed for processors where sizeof extended = sizeof(double)

Jonas Maebe 21 anos atrás
pai
commit
bfd9c1f91c
1 arquivos alterados com 7 adições e 3 exclusões
  1. 7 3
      tests/test/tstrreal2.pp

+ 7 - 3
tests/test/tstrreal2.pp

@@ -26,16 +26,20 @@ var
   e: extended;
   c: longint;
   s2: string;
-
+  lenadjust: longint;
 begin
+  if sizeof(extended) = 8 then
+    lenadjust := 2
+  else
+    lenadjust := 0;
   e := 10.0;
   for c := 1 to 21 do
     begin
       str(e:0:17,s2);
       writeln(s2);
-      if s2 <> s[c] then
+      if s2 <> copy(s[c],1,length(s[c])-lenadjust) then
         begin
-          writeln('  Error, should be ',s[c]);
+          writeln('  Error, should be ',copy(s[c],1,length(s[c])-lenadjust));
           halt(1);
         end;
       e := e / 10.0;