Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix pow_n opcode, add missing mod_n and infix:<%> for Num.
Patch courtesy by kboga++
  • Loading branch information
moritz committed Jun 22, 2011
1 parent 4272fe4 commit 9ccc8eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -13,9 +13,10 @@ INIT {
abs_i => 'abs__Ii',
abs_n => 'abs__Nn',
mod_i => 'mod__Iii',
mod_n => 'mod__Nnn',
lcm_i => 'lcm__Iii',
gcd_i => 'gcd__Iii',
pow_n => 'mod__Nnn',
pow_n => 'pow__Nnn',
cmp_i => 'cmp__Iii',
cmp_n => 'cmp__Inn',
);
Expand Down
4 changes: 4 additions & 0 deletions src/core/Num.pm
Expand Up @@ -148,6 +148,10 @@ multi infix:</>(Num \$a, Num \$b) {
nqp::p6box_n(nqp::div_n(nqp::unbox_n($a), nqp::unbox_n($b)))
}

multi infix:<%>(Num \$a, Num \$b) {
nqp::p6box_n(nqp::mod_n(nqp::unbox_n($a), nqp::unbox_n($b)))
}

multi infix:<**>(Num \$a, Num \$b) {
nqp::p6box_n(nqp::pow_n(nqp::unbox_n($a), nqp::unbox_n($b)))
}
Expand Down

0 comments on commit 9ccc8eb

Please sign in to comment.