Skip to content
Permalink
Browse files

Add native candidate for infix:<%%>

  • Loading branch information...
MasterDuke17 committed Oct 18, 2018
1 parent 4bf55b1 commit 3d161a5627557162bab78d9bdb920637f057a30a
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/Int.pm6
@@ -327,6 +327,10 @@ multi sub infix:<%>(int $a, int $b --> int) {
nqp::mod_i(nqp::add_i(nqp::mod_i($a,$b),$b),$b) # quick fix RT #128318
}

multi sub infix:<%%>(int $a, int $b) {
nqp::hllbool(nqp::iseq_i(nqp::mod_i($a, $b), 0))
}

multi sub infix:<**>(Int:D \a, Int:D \b) {
my $power := nqp::pow_I(nqp::decont(a), nqp::decont(b >= 0 ?? b !! -b), Num, Int);
# when a**b is too big nqp::pow_I returns Inf

0 comments on commit 3d161a5

Please sign in to comment.
You can’t perform that action at this time.