Skip to content

Commit

Permalink
Merge pull request #787 from zoffixznet/fix-approx-op
Browse files Browse the repository at this point in the history
Fix RT#128421
  • Loading branch information
lizmat committed Jun 17, 2016
2 parents 21f0be1 + ee915c3 commit 70c19dd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/core/Numeric.pm
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ multi sub infix:<≅>(\a, \b, :$tolerance = $*TOLERANCE) {
# If operands are non-0, scale the tolerance to the larger of the abs values.
# We test b first since $value ≅ 0 is the usual idiom and falsifies faster.
if b && a && $tolerance {
my $a = a.abs;
my $b = b.abs;
abs($a - $b) < ($a max $b) * $tolerance;
abs(a - b) < (a.abs max b.abs) * $tolerance;
}
else { # interpret tolerance as absolute
abs(a.Num - b.Num) < $tolerance;
Expand Down

0 comments on commit 70c19dd

Please sign in to comment.