[Issue 12169] sum(int[]) should return a int

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 15 06:15:30 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12169



--- Comment #2 from Andrei Alexandrescu <andrei at erdani.com> 2014-02-15 06:15:26 PST ---
If sum returned int for ranges of int, it would be 100% identical to
std.algorithm.reduce. It's worth returning a 64-bit quantity because (a) 64-bit
summing is about as fast as 32-bit summing, (b) the result can be cast to int
if needed.

I propose we close this.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list