Permalink
Browse files

Workaround for % bug.

This can surely be done more efficiently, but for now this works.
  • Loading branch information...
1 parent 2eb3d1d commit 05624246f8cecda059b97a55362da5c041caa628 @colomon colomon committed Jul 12, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/Num.pm
View
@@ -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)

0 comments on commit 0562424

Please sign in to comment.