Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
thinkos, syntax errors
  • Loading branch information
moritz committed Feb 12, 2012
1 parent b23da9e commit f27eab1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/Rat.pm
@@ -1,5 +1,4 @@
my Int $UINT64_UPPER = nqp::pow_I(2, 64, Num, Int);
subset UInt64 of Int where { 0 <= $_ < $UINT64_UPPER }

my role Rational is Real {
has Int $.numerator;
Expand Down Expand Up @@ -74,7 +73,7 @@ sub DIVIDE_NUMBERS(Int:D \$nu, Int:D \$de, $t1, $t2) {
nqp::bindattr($r, FatRat, '$!numerator', nqp::p6decont($numerator));
nqp::bindattr($r, FatRat, '$!denominator', nqp::p6decont($denominator));
$r;
} elsif $denominator <= $UINT64_UPPER {
} elsif $denominator < $UINT64_UPPER {
my $r := nqp::create(Rat);
nqp::bindattr($r, Rat, '$!numerator', nqp::p6decont($numerator));
nqp::bindattr($r, Rat, '$!denominator', nqp::p6decont($denominator));
Expand Down Expand Up @@ -143,7 +142,7 @@ multi sub infix:<->(Rational \$a, Int \$b) {
multi sub infix:<->(Int \$a, Rational \$b) {
DIVIDE_NUMBERS
$a * $b.denominator - $b.numerator,
$b.denominator
$b.denominator,
$a,
$b;
}
Expand Down

0 comments on commit f27eab1

Please sign in to comment.