Re: [PATCH: perl@8342] comp/proto..........FAILED tests 112-123
[p5sagit/p5-mst-13.2.git] / t / lib / trig.t
index 9420cd3..6949622 100755 (executable)
@@ -10,7 +10,7 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    @INC = '../lib';
 }
 
 use Math::Trig;
@@ -26,7 +26,8 @@ if ($^O eq 'unicos') { # See lib/Math/Complex.pm and t/lib/complex.t.
 }
 
 sub near ($$;$) {
-    abs($_[0] - $_[1]) < (defined $_[2] ? $_[2] : $eps);
+    my $e = defined $_[2] ? $_[2] : $eps;
+    $_[1] ? (abs($_[0]/$_[1] - 1) < $e) : abs($_[0]) < $e;
 }
 
 print "1..23\n";