فهرست منبع

+ sincos test

git-svn-id: trunk@5808 -
florian 18 سال پیش
والد
کامیت
abdcb8cdf2
1فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 15 0
      tests/test/units/math/ttrig1.pp

+ 15 - 0
tests/test/units/math/ttrig1.pp

@@ -27,6 +27,7 @@ const
 var
   i : integer;
   Delta,Ref,Value : Double;
+  Ref2,Value2,Dummy : Float;
 
 begin
 for i:=1 to dim do
@@ -107,6 +108,20 @@ for i:=-1 downto -8 do
     end;
   end;
 
+writeln('Testing SINCOS');
+for i:=1 to dim do
+  begin
+  sincos(pi/2-i*10/180*pi,Ref2,Dummy);
+  sincos(i*10/180*pi,Dummy,Value2);
+  Delta := Value2 - Ref2;
+  if Abs(Delta) > 1E-15 then
+    begin
+      writeln('  Error for Cos(',i*10,') was:',Value2,' should be:',Ref2) ;
+      halt(1);
+    end;
+  end;
+
+
 writeln('Tan +/- 90 deg test:');
 writeln('tan(89.999):',tan(89.999/180*pi));
 writeln('tan(90.000):',tan(90.000/180*pi));