Karim Belabas on Mon, 19 Nov 2018 19:55:19 +0100


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

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]
`