make testsuite somewhat location independent
[p5sagit/p5-mst-13.2.git] / t / lib / complex.t
index 2783e42..6fbdf8d 100755 (executable)
@@ -9,12 +9,12 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    @INC = '../lib';
+    unshift @INC, '../lib';
 }
 
 use Math::Complex;
 
-$VERSION = sprintf("%s", q$Id: complex.t,v 1.8 1998/02/05 16:03:39 jhi Exp $ =~ /(\d+\.d+)/);
+my $VERSION = sprintf("%s", q$Id: complex.t,v 1.9 1998/11/01 00:00:00 dsl Exp $ =~ /(\d+\.d+)/);
 
 my ($args, $op, $target, $test, $test_set, $try, $val, $zvalue, @set, @val);
 
@@ -26,6 +26,11 @@ my @script = (
 );
 my $eps = 1e-13;
 
+if ($^O eq 'unicos') {         # For some reason root() produces very inaccurate
+    $eps = 1e-11;      # results in Cray UNICOS, and occasionally also
+}                      # cos(), sin(), cosh(), sinh().  The division
+                       # of doubles is the current suspect.
+
 while (<DATA>) {
        s/^\s+//;
        next if $_ eq '' || /^\#/;
@@ -168,20 +173,6 @@ test_loz(
         'acoth(-1)',
        );
 
-# test the 0**0
-
-sub test_ztz {
-    $test++;
-
-    push(@script, <<'EOT');
-eval 'cplx(0)**cplx(0)';
-print 'not ' unless ($@ =~ /zero raised to the zeroth/);
-EOT
-    push(@script, qq(print "ok $test\\n";\n));
-}
-
-test_ztz;
-
 # test the bad roots
 
 sub test_broot {
@@ -382,6 +373,7 @@ __END__
 (1,0):(2,3):(1,0)
 (2,3):(0,0):(1,0)
 (2,3):(1,0):(2,3)
+(0,0):(0,0):(1,0)
 
 &Re
 (3,4):3
@@ -871,4 +863,3 @@ __END__
 ( 2,-3):(  0.14694666622553,  0.23182380450040)
 
 # eof
-