Skip to content

Commit

Permalink
Int**Int does not produce an Int if the RHS is negative
Browse files Browse the repository at this point in the history
... so don't try to corece to Int in that case.

Fixes RT #73262
  • Loading branch information
moritz committed Mar 7, 2010
1 parent d4d58aa commit 201e027
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/Int.pm
Expand Up @@ -68,7 +68,11 @@ our multi sub infix:<%>(Int $a, Int $b) {
}

our multi sub infix:<**>(Int $a, Int $b) {
upgrade_to_num_if_needed(pir::pow__NNN($a, $b))
if $b >= 0 {
upgrade_to_num_if_needed(pir::pow__NNN($a, $b))
} else {
pir::pow__NNN($a, $b)
}
}

our multi sub prefix:<->(Int $a) {
Expand Down

0 comments on commit 201e027

Please sign in to comment.