Bill Allombert on Sun, 20 Jun 2004 19:29:41 +0200


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

Re: subst?


On Sun, Jun 20, 2004 at 04:21:27PM +0200, Ralf Stephan wrote:
> I am not sure if I understand what Bill writes about the new 
> behaviour of subst. The version is 2.2.8 from June 3.
>  
> ? subst(x^3+1,x+1,x-1)
> %3 = x^3 - 6*x^2 + 12*x - 7
> ? subst(x^3+y^3,x+y,x-y)
> %4 = x^3 - 6*y*x^2 + 12*y^2*x - 7*y^3
>  
> Is this supposed to work?

The changes was made on 2004/06/15. Before that date, this was supposed
to work with the unstable branch only.

Now, you should use substpol instead.

? subst(x^3+1,x+1,x-1)
  ***   variable name expected: subst(x^3+1,x+1,x-1)
                                            ^--------
? substpol(x^3+1,x+1,x-1)
%1 = x^3 - 6*x^2 + 12*x - 7

One of the reason of the change is to keep the error message when you
inadvertently use a polynomial instead of a variable.

Cheers,
Bill.