Bill Allombert on Fri, 19 Sep 2014 10:51:32 +0200


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

Re: Proposal for overriding vecsum( ) in future versions.


On Thu, Sep 18, 2014 at 07:59:02PM -0430, R. J. Cano wrote:
> /* R. J. Cano <eerrrraattaa@gmail.com>, Sept 19 2014 */
> 
> ? vecsum
> vecsum(v): return the sum of the component of the vector v
> 
> ? vecsum_
> vecsum(v)_: if b is omitted or 1, return the sum of component of the vector v,
>             otherwise if b is zero read v from left to right as the digits of
>             a number in the least base (1 + greatest component in v), else if
>             the components in v are smaller than b read in the base b, else
>             return -1;
> 
> Motivation: In some cases vecsum_() might be considered the inverse of digits.

Your proposal matches another one I made previously
<http://pari.math.u-bordeaux.fr/archives/pari-users-1407/msg00020.html>
which was to add a function 'fromdigits'.

Do you have a better name to offer ?

Cheers,
Bill.