C++ Ranges proposal for the Standard Library

via Digitalmars-d digitalmars-d at puremagic.com
Sat Oct 18 05:22:37 PDT 2014


On Saturday, 18 October 2014 at 12:16:24 UTC, John Colvin wrote:
> writeln(a.kahanSum);        // 111.157
> writeln(a.sum);             // -1272
> writeln(a.sort().kahanSum); // 0

Yes, but it is misleading, my test case was bad. Try to add a 1.0 
element to the array.

a.append(1.0)
a = sorted(a)

print sum(a), kahan(a), accurate(a)

-1024.0 0.0 1.0





More information about the Digitalmars-d mailing list