Bill Allombert on Wed, 28 Jun 2006 20:56:07 +0200


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

Re: divrem bug?


On Wed, Jun 28, 2006 at 08:30:39PM +0200, Bernard Parisse wrote:
> 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.

It works only if the optional 3rd arg has higher priority:

? divrem(y+1,y^2,x)
%1 = [(y + 1)/y^2, 0]~
? divrem(y+1,y^2,y)
%2 = [0, y + 1]~

This still useful.

> Otherwise, I believe that the fix should be in the C divrem function,
> it should reorder variables before doing the division.

Experimentally doing that almost always break something due to 
t_POLMOD objects.

> 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

Please extract it from the pari.desc file instead.
(We provide a perl module PARI::822 for that purpose).

> 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?

Please see
<http://pari.math.u-bordeaux.fr/dochtml/html.stable/>
However gphtml only display the long help of functions, not the manual
body text.

PARI doc is in TeX, not in LaTeX so latex2html will not work.

Cheers,
Bill.