New submission from Jean Brouwers <[EMAIL PROTECTED]>: Here is one more, final attempt to improve fast summation, somewhat.
This version inspects the type of both the sum and the first item and adds all ints and floats without any PyNumber_Add() call and in order. Also, the results for this test case are compatible: >>> d = [1000000000000000, -1000000000000000.0, .0000000000000001, .0000000000000001] >>> sum(d) 2e-16 >>> d[0] + sum(d[1:]) 0.0 /Jean Brouwers ---------- components: Interpreter Core files: bltinmodule3.c.diff keywords: patch messages: 66434 nosy: MrJean1 severity: normal status: open title: alternate fast builtin sum, rev'd type: performance versions: Python 2.6 Added file: http://bugs.python.org/file10223/bltinmodule3.c.diff __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2792> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com