[R] Best way to compute a sum

Peter Langfelder peter.langfelder at gmail.com
Thu Jun 24 22:57:11 CEST 2010


On Thu, Jun 24, 2010 at 1:50 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 24/06/2010 4:39 PM, Peter Langfelder wrote:
>
>> AFAIK the optimal way of summing a large number of positive numbers is
>> to always add the two smallest numbers
>
> Isn't that what I said?

I understood that you suggested to linearly sum the numbers from the
smallest to the largest. That would take an initial sort and then a
simple sum. My idea is to keep the order throughout. Apologies if I
misunderstood.

Peter



More information about the R-help mailing list