Bill Allombert on Wed, 28 Jun 2006 18:45:52 +0200

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

Re: divrem bug?

On Wed, Jun 28, 2006 at 02:58:57PM +0200, Bernard Parisse wrote:
> Hi!
> under pari 2.3.0, divrem(x+1,x^2,y) returns 
> %1 = [1/y^2*x + 1/y^2, 0]
> It should be something corresponding to [(x+1)/x^2, 0], 
> y should not occur there. Or is it not handled under pari?

Well returning incorrect output is a bug but I would not expect
divrem(x+1,x^2,y) to work because this breaks variable priorities.

See the PARI manual, chapter 2, Variable priorities, multivariate objects
(??"Variable priorities, multivariate objects"@2).

If you want to work in K(x)[y] instead of K(y)[x], you need to define
variables priorities so that x << y. Unfortunately,  this is not
possible with the 'x variable which has always highest priority, so the
simplest is to do:

? Y;X;\\ Y >> X
? divrem(X+1,X^2,Y)
%2 = [(X + 1)/X^2, 0]~

We have a long plan to allow the user to add new variables with
specified priorities though...