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.
if ($_[1] == $_[2]) {
print "ok $_[0]\n";
} else {
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 {
if ($error < 1e-9) {
print "ok $_[0] # $_[1] is close to $_[2], \$^O eq $^O\n";
} else {