Jacques Gélinas on Mon, 19 Nov 2018 20:19:39 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
RE: apply(sign,x) == x |
> returns the polynomial
\sum f(a_i) x^i
Thanks for the explanation. This example could be added to ??apply
? apply(x->x^2, 4*x^2 + 3*x + 2)
%3 = 16*x^2 + 9*x + 4
? apply(sign, 4*x^2 - 3*x + 2)
%4 = x^2 - x +1
Jacques Gélinas De : Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
Envoyé : 19 novembre 2018 13:55 À : Jacques Gélinas Cc : pari-users@pari.math.u-bordeaux.fr Objet : Re: apply(sign,x) == x * Jacques Gélinas [2018-11-19 19:38]:
> apply(f, A): If A is a polynomial or power series, apply f on all coefficients. > > > Of course, I would expect sign not to return a polynomial, but -1, 0, or 1 as in > > > apply(sign,Vec(x)) == [1,0] apply(f, a t_POL \sum a_i x^i) applies f to each coefficient, i.e. it returns the polynomial \sum f(a_i) x^i ? apply(n->n+1,'x) %1 = 2*x + 1 Cheers, K.B. -- Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17 Universite de Bordeaux Fax: (+33) (0)5 40 00 21 23 351, cours de la Liberation http://www.math.u-bordeaux.fr/~kbelabas/ F-33405 Talence (France) http://pari.math.u-bordeaux.fr/ [PARI/GP] ` |