Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unbreak 98c32aa for parrot (RT #122681)
  • Loading branch information
lizmat committed Sep 2, 2014
1 parent ef380d2 commit a640aab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/Int.pm
Expand Up @@ -154,6 +154,9 @@ multi infix:<div>(Int:D \a, Int:D \b) {
nqp::div_I(nqp::decont(a), nqp::decont(b), Int)
}
multi infix:<div>(int $a, int $b) returns int {
#?if parrot
fail X::Numeric::DivideByZero.new unless $b; # XXX temporary fix
#?endif
# relies on opcode or hardware to detect division by 0
nqp::div_i($a, $b)
}
Expand All @@ -163,6 +166,9 @@ multi infix:<%>(Int:D \a, Int:D \b) returns Int {
nqp::mod_I(nqp::decont(a), nqp::decont(b), Int);
}
multi infix:<%>(int $a, int $b) returns int {
#?if parrot
fail X::Numeric::DivideByZero.new(using => 'infix:<%>') unless $b;
#?endif
# relies on opcode or hardware to detect division by 0
nqp::mod_i($a, $b)
}
Expand Down

0 comments on commit a640aab

Please sign in to comment.