Emile State on Sat, 01 Sep 2012 18:36:13 +0200

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

Re: new digits() function


On Sat, Sep 1, 2012 at 5:43 AM, Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr> wrote:
Dear PARI developers,

I have added a GP function digits(n,B) to compute the digits in base B of n.
? digits(167,3)
%7 = [2,0,0,1,2]

Together with Pol, it can be used to convert integers to polynomials:
? Pol(digits(167,3))
%1 = 2*x^4+x+2
The reverse can be done using subst:
? subst(%1,x,3)
%2 = 167