Skip to content

Commit

Permalink
Add Rat.prefix<->.
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
  • Loading branch information
colomon authored and moritz committed Sep 2, 2009
1 parent c6d5941 commit 47a6ae6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/setting/Rat.pm
Expand Up @@ -58,6 +58,10 @@ multi sub infix:<->(Int $a, Rat $b) {
Rat.new($a * $b.denominator - $b.numerator, $b.denominator);
}

multi sub prefix:<->(Rat $a) {
Rat.new(-$a.numerator, $a.denominator);
}

multi sub infix:<*>(Rat $a, Rat $b) {
Rat.new($a.numerator * $b.numerator, $a.denominator * $b.denominator);
}
Expand Down

0 comments on commit 47a6ae6

Please sign in to comment.