Bernard Parisse on Wed, 28 Jun 2006 20:37:53 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: divrem bug? |
Bill Allombert wrote: >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. > Does it mean that divrem only works when the optionnal 3rd arg is the main variable? In that case, the default argument should probably be omitted. Otherwise, I believe that the fix should be in the C divrem function, it should reorder variables before doing the division. >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]~ > Thanks. In fact, I'm not specially interested to do that with pari, since xcas does it natively with quorem, but I'm coding a complete integration of every PARI function inside xcas (interested people can test it in the debian package of giac on my site, see link below, the command pari() inside xcas exports PARI functions), and doing tests I came to this output, I thought first that it was my conversion code that was buggy (it is most probably buggy but it was not the case this time...). I have a question about the documentation: currently I'm using the short on-line doc available from src/language/init.h, but I would like to have HTML online doc like for native xcas functions (currently only in French), is there a way to convert the PARI tex doc using something like latex2html? Bye, Bernard ftp://ftp-fourier.ujf-grenoble.fr/xcas/giac_0.6.0_i386.deb