From: Spider Boardman Date: Tue, 29 Aug 2000 19:58:56 +0000 (-0400) Subject: Make the epsilon to be relative, not absolute. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e64f0054c65de1a097c72a5d43578d1a5bcf0e38;p=p5sagit%2Fp5-mst-13.2.git Make the epsilon to be relative, not absolute. Subject: Re: [ID 20000829.039] Not OK: perl v5.7.0 +DEVEL6899 +[ID on alpha-dec_osf-ld 5.1 (UNINSTALLED) Message-Id: <200008292358.TAA31114@leggy.zk3.dec.com> p4raw-id: //depot/perl@6905 --- diff --git a/t/lib/trig.t b/t/lib/trig.t index ac34450..6949622 100755 --- a/t/lib/trig.t +++ b/t/lib/trig.t @@ -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";