Peter Bruin on Tue, 27 Oct 2015 16:27:13 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Faster digits and fromdigits in base 2^k, and FlxqM_mul_Kronecker |
Hi Bill, > In the documentation of fromdigits_2k_zv: > > as I understand, x[i] is treated as a ulong, and not as a long. > The meaning of "here $k$ may be any positive \kbd{long}." should be > clarified to be more explicit when k is equal or larger than > BITS_IN_LONG > > But more importantly, the fromdigits_2k_zv should be called > zv_fromdigits_2k, because the input is a zv and not the output. > > And in fact, more accurately, it should be nv_fromdigits_2k because > the entries are treated as unsigned. (the original functions > binary_2k_zv and binary_zv have the same problem) What I had in mind whas that fromdigits_2k_zv should only be called with entries that are non-negative longs, or equivalently (for our purposes) ulongs with the most significant bit equal to zero. This is because I thought that a t_VECSMALL was by definition a vector of longs (based on the fact that GP interprets them as such). Now I see that there are precedents for interpreting them as vectors of ulongs instead, so it is logical to change this. The logic behind changing the name of the function to nv_fromdigits_2k also makes sense to me. I will send an updated patch soon. Thanks, Peter