We have discussed summing algorithms a number of times before (see http://bugzilla.gnome.org/show_bug.cgi?id=131588, for example) and it is a hard problem.
Sorting works great if and if only all the numbers have the same sign. If not, I do not currently know what is best. In fact, all the simple algorithms we have thought up have been immediately met with a counter example. Whatever is best, probably involves looking for subsets whose (true) sum is small. That would be very expensive. Notice, though, that in your example, the best order is the more or less *reverse* sorted, i.e., start with the absolute biggest. Then the largest numbers cancel out nicely. Morten _______________________________________________ gnumeric-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnumeric-list
