Skip to content

Commit

Permalink
Workaround for % bug.
Browse files Browse the repository at this point in the history
This can surely be done more efficiently, but for now this works.
  • Loading branch information
colomon committed Jul 12, 2013
1 parent 2eb3d1d commit 0562424
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/Num.pm
Expand Up @@ -295,7 +295,13 @@ multi infix:</>(num $a, num $b) {
}

multi infix:<%>(Num:D \a, Num:D \b) {
#?if jvm
# This can surely be done more efficiently, but this works.
a - floor(a / b) * b;
#?endif
#?if !jvm
nqp::p6box_n(nqp::mod_n(nqp::unbox_n(a), nqp::unbox_n(b)))
#?endif
}
multi infix:<%>(num $a, num $b) {
nqp::mod_n($a, $b)
Expand Down

0 comments on commit 0562424

Please sign in to comment.