Bill Allombert on Sat, 01 Sep 2012 11:43:28 +0200

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

new digits() function

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