Bill Allombert on Sat, 16 Nov 2019 19:04:39 +0100


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

Re: List of polynomial coefficients in GP


On Fri, Nov 15, 2019 at 05:55:15PM +0000, Jacques Gélinas wrote:
> >(Bill Allombert)  Fundamentally this is a bug in subst:
> 
> Looks like a feature of Vec, which simplifies its input, and I would not want to change that.
> 
>              Vec(Pol(subst(1*u+2*P-6,u,x+3))) == [1, 2*P - 3]
>              Vec(Pol(subst(0*u+2*P-6,u,x+3))) == [2, -6]

Vec does not simplify its input, you are misunderstanding what Pol is
doing there (i.e nothing), but you are on the right track!
Try

Vec(u^0*subst(0*u+2*P-6,u,x+3)) == [2*P-6]

Cheers,
Bill.