Karim BELABAS on Wed, 12 Mar 2003 19:49:10 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PATCH CVS] yet better subst()


On Sun, 23 Feb 2003, Ilya Zakharevich wrote:
>   a) removes a stupid lift(Mod(pol,M), variable(M)) which should be
>      equivalent to pol % M;

No, not stupid. The CVS code read

  tmp = gmul(pol, gmodulcp(gun, tmp));

not  [ as per your original patch ]

  tmp = gmodulcp(pol, tmp));

This is necessary if gvar(tmp) has lower precedence than gvar(pol)
[ otherwise the result of gmod(pol, tmp), or gmodulcp(pol, tmp) is an exact 0.
Not good (bug report by Michael Somos, pari-dev-2432) ].

I have adapted your patch.

    Karim.
-- 
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425   Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://www.parigp-home.de/  [PARI/GP]