Skip to content

Commit

Permalink
Minor changes needed for GLR.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Sep 2, 2015
1 parent ce433a7 commit f089372
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Math/Polynomial.pm
Expand Up @@ -46,8 +46,8 @@ class Math::Polynomial {
my $max = $a.coefficients.elems
max $b.coefficients.elems;

all(( $a.coefficients, 0 xx *
Z== $b.coefficients, 0 xx * )[^$max]);
all(( |$a.coefficients, |(0 xx *)
Z== |$b.coefficients, |(0 xx *) )[^$max]);
}
multi sub infix:<!=>(Math::Polynomial $a, Math::Polynomial $b) is export(:DEFAULT) {
!($a == $b);
Expand All @@ -56,9 +56,8 @@ class Math::Polynomial {
multi sub infix:<+>(Math::Polynomial $a, Math::Polynomial $b) is export(:DEFAULT) {
my $max = $a.coefficients.elems
max $b.coefficients.elems;

$a.new: ( $a.coefficients, 0 xx *
Z+ $b.coefficients, 0 xx * )[^$max];
$a.new: ( |$a.coefficients, |(0 xx *)
Z+ |$b.coefficients, |(0 xx *) )[^$max];
}

multi sub infix:<+>(Math::Polynomial $a, $b) is export(:DEFAULT) {
Expand Down

0 comments on commit f089372

Please sign in to comment.