Loïc Grenié on Tue, 30 Jan 2018 14:23:09 +0100


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

Re: Optional parameter to digits() / binary() functions for fixed vector size output


On 2018-01-29 at 21:28 GMT+01:00 Jérôme wrote:

Dear all,

Would it be possible to add an optional parameter ‘len’ to ‘digits()’ and ‘binary()’ functions in order to pad the output on the left with zeros to give a vector of at least length ‘len’.

It is sometime useful to iterate over all representations of b^n-1 in base b (usually in base 2) and it would be useful to have digits(1, b, n) to return [0, 0, …, 1] instead of [1].


     Hi!

     Maybe forvec is your friend in that case.

          Loïc