Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add JVM wrapper around code only needed for JVM.
  • Loading branch information
colomon committed Jul 12, 2013
1 parent 44b57b5 commit 2eb3d1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Num.pm
Expand Up @@ -302,7 +302,10 @@ multi infix:<%>(num $a, num $b) {
}

multi infix:<**>(Num:D \a, Num:D \b) {
#?if jvm
# Parrot takes care of this for you in pow_n
return 1 if a == 1 && !b.isNaN;
#?endif
nqp::p6box_n(nqp::pow_n(nqp::unbox_n(a), nqp::unbox_n(b)))
}
multi infix:<**>(num $a, num $b) {
Expand Down

3 comments on commit 2eb3d1d

@moritz
Copy link
Member

@moritz moritz commented on 2eb3d1d Jul 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that rakudo-parrot and rakudo-jvm return the same type (Int vs. Num) with this patch?

@colomon
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Time to add a test, I guess....

@colomon
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test added, and another patch to fix this one. moritz++

Please sign in to comment.