summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-06-18 21:49:39 +0200
committerNicholas Clark <nick@ccl4.org>2012-06-19 10:13:06 +0200
commit66d2c7cb575fb77aa0403c44521daff3e400f738 (patch)
tree0c2b4806f39eeef64e3df6a9dfb91f0e689be86f
parentff49cf17e438aa22d1c89e69ab571eb90dca043c (diff)
downloadperl-66d2c7cb575fb77aa0403c44521daff3e400f738.tar.gz
In t/op/arith.t, tryeq_sloppy() wasn't correctly handling negative values.
The code was treating any negative value as "ok", rather than only those within 1e-9 of the expected value. This bug has been present since tryeq_sloppy() was added by commit 800e6488b45c59f1 in Oct 2001.
-rw-r--r--t/op/arith.t2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/op/arith.t b/t/op/arith.t
index 290640244a..01df2c8811 100644
--- a/t/op/arith.t
+++ b/t/op/arith.t
@@ -21,7 +21,7 @@ sub tryeq_sloppy ($$$) {
if ($_[1] == $_[2]) {
print "ok $_[0]\n";
} else {
- my $error = abs ($_[1] - $_[2]) / $_[1];
+ my $error = abs (($_[1] - $_[2]) / $_[1]);
if ($error < 1e-9) {
print "ok $_[0] # $_[1] is close to $_[2], \$^O eq $^O\n";
} else {