Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement infix:<%%> "is divisible by" operator.
  • Loading branch information
colomon committed Jun 26, 2010
1 parent a579f8e commit 7102d7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -1679,6 +1679,7 @@ token infix:sym</> { <sym> <O('%multiplicative')> }
token infix:sym<div> { <sym> <O('%multiplicative')> }
token infix:sym<%> { <sym> <O('%multiplicative')> }
token infix:sym<mod> { <sym> <O('%multiplicative')> }
token infix:sym<%%> { <sym> <O('%multiplicative')> }
token infix:sym<+&> { <sym> <O('%multiplicative')> }
token infix:sym<~&> { <sym> <O('%multiplicative')> }
token infix:sym<?&> { <sym> <O('%multiplicative')> }
Expand Down
4 changes: 4 additions & 0 deletions src/core/operators.pm
Expand Up @@ -55,6 +55,10 @@ our multi sub infix:<%>($a, $b) {
+$a % +$b;
}

our multi sub infix:<%%>($a, $b) {
+$a % +$b == 0;
}

our multi sub infix:<**>($a, $b) {
(+$a) ** +$b; # parenthesis needed because of precendence.
}
Expand Down

0 comments on commit 7102d7c

Please sign in to comment.