C++ Ranges proposal for the Standard Library
via Digitalmars-d
digitalmars-d at puremagic.com
Sat Oct 18 05:35:22 PDT 2014
On Saturday, 18 October 2014 at 12:22:38 UTC, Ola Fosheim Grøstad
wrote:
> 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.
Note: the sort should be over abs(x) to have an effect, but then
we would need a different dataset since +N and -N will cancel out
too easily.
More information about the Digitalmars-d
mailing list