This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients MrJean1, pitrou, rhettinger
Date 2008-05-08.07:45:06
SpamBayes Score 0.0015230748
Marked as misclassified No
Message-id <1210232711.36.0.890949904548.issue2785@psf.upfronthosting.co.za>
In-reply-to
Content
The approach of using separate accumulations is intrinsically flawed if 
you want the same result as a regular sum().  Here's a small dataset 
that shows why you can't accumulate separate sums by type:

>>> d = [1000000000000000, -
1000000000000000.0, .0000000000000001, .0000000000000001]
>>> sum(d)
2e-16
>>> d[0] + sum(d[1:])
0.0

Closing this one.  The approach is doomed and the possible benefits 
over the current approach are microscopic at best and only apply to 
unusual corner cases. 

I also prefer the current approach because it is easily extended to 
LongLongs and it is easy to show that the code is correct (at least 
with respect to producing the same result as a regular sum()).
History
Date User Action Args
2008-05-08 07:45:12rhettingersetspambayes_score: 0.00152307 -> 0.0015230748
recipients: + rhettinger, pitrou, MrJean1
2008-05-08 07:45:11rhettingersetspambayes_score: 0.00152307 -> 0.00152307
messageid: <1210232711.36.0.890949904548.issue2785@psf.upfronthosting.co.za>
2008-05-08 07:45:09rhettingerlinkissue2785 messages
2008-05-08 07:45:07rhettingercreate