quick addition of many numbers
Greetings,
I'm looking to do some adding. For one, I'd like to be able to quickly add the numbers present in a list together. No [zl] mode that I know of does this. My list contains, for example, [1, 3, 4, 6, 7]. Upon inputting the list into this object, the sum (21) will be output.
Also, I'd like to have an object or abstraction that keeps a running total of the sum of all the numbers which are input into it.
These two are actually pretty similar. What's the best way of accomplishing this in 4.6?
Jay
[accum]
I would say [iter] - [accum]
but bizarrely on my machine on both max 5 and 4.6, accum isn't accumulating.
Mac OS X 10.5.4
Max 5.0.3 and 4.6.3
Thanks for the responses. I'm not familiar with [accum]. Sounds like I need to get familiar.
Jay
There is a zl mode. It's zl sum. I'm not sure if that mode exists under 4.6, however. Accum certainly will work, and you could easily use iter, trigger, and accum together to make an abstraction that did the same thing as zl sum.
On Sep 2, 2008, at 11:28 AM, Jer Welter wrote:
> There is a zl mode. It's zl sum. I'm not sure if that mode exists
> under 4.6, however.
It doesn't.
You could also use + with feedback:
Chris Muir
cbm@well.com
http://www.xfade.com
another option, providing the lists don't get longer than 9 items:
expr $i1+$i2+$i3+$i4+$i5+$i6+$i7+$i8+$i9
On 2 sept. 08, at 21:49, Klaas-Jan Govaart wrote:
> another option, providing the lists don't get longer than 9 items:
another one: [mean] * [zl len] ;-)
ej
Send your list to lp.sigma.
It's that easy.
Lp.sigma is in the Litter Starter Pack. URI below.
Some folks have suggested that a name like "lp.add" or "lp.sum" might be more obvious, but I actually polled Litter Power users on this and the broad majority found sigma sufficiently obvious and/or more attractive. So there it is.
Best -- Peter
Quote: Emmanuel Jourdan wrote on Wed, 03 September 2008 00:23
----------------------------------------------------
> another one: [mean] * [zl len] ;-)
----------------------------------------------------
Cute, but does have potential precision problems with int/float conversion.
Never mind that it's a Rube Goldberg-like solution to a simple problem. (Heath Robinson for the Brits)