On 07/30/2016 03:53 AM, oldk1331 wrote: > diff --git a/src/algebra/poly.spad b/src/algebra/poly.spad > index b67beeb..b3768b8 100644 > --- a/src/algebra/poly.spad > +++ b/src/algebra/poly.spad > @@ -581,11 +581,11 @@ > cons([p.first.k, cf], (a * p.rest)) > if R has Ring then > fmecg(p1 : %, e : E, r : R, p2 : %) : % == -- p1 - r * X^e * > p2 > + r = 0 => p1 > rout : % := [] > r := - r > for tm in p2 repeat > c2 := r * tm.c > - c2 = 0 => "next term" > e2 := e + tm.k > while not null p1 and p1.first.k > e2 repeat > (rout := cons(p1.first, rout); p1 := p1.rest) --use > PUSH and POP? > > > ======= > > tm.c can't be 0, so "c2 = 0" implies "r = 0", so we can skip > the check in loop.
If R is IntegerMod(6) and r=3, tm.c=2, then we get c2=0. Maybe it would be an idea to have two implementations for rings with and without zerodivisors. > BTW, using '=> "next term"' is awkward, I agree. Furthermore, it's easy to misinterpret this construction as "if c2=0 then break". > the axiom book says we should use 'iterate', but compiler doesn't > recognize it anymore. So we should fix the documentation then? > (doc/htex/ug05.htex) I'd rather like to see the compiler fixed. Ralf -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
