Jérôme Raulin on Mon, 29 Jan 2018 21:28:39 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Optional parameter to digits() / binary() functions for fixed vector size output |
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]. Thanks very much. Regards. Jerome. |