Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
infix:<mod> should not coerce.
  • Loading branch information
colomon committed Sep 7, 2013
1 parent aa657cc commit a13cec9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/Real.pm
Expand Up @@ -115,11 +115,10 @@ multi infix:«>=»(Real \a, Real \b) { a.Bridge >= b.Bridge }
multi prefix:<->(Real \a) { -a.Bridge }

# NOTE: According to the spec, infix:<mod> is "Not coercive,
# so fails on differing types." This implemention ignores
# that constraint.
# so fails on differing types." Thus no casts here.
proto sub infix:<mod>($, $) {*}
multi sub infix:<mod>(Real $a, Real $b) {
$a - ($a.Bridge.Int div $b.Bridge.Int) * $b;
$a - ($a div $b) * $b;
}

multi sub abs(Real \a) {
Expand Down

0 comments on commit a13cec9

Please sign in to comment.