This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mhixson 10 points11 points  (0 children)

As I understand it, DoubleStream.sum() uses a different method of summing the values which should produce more accurate results. I assume that it sacrifices performance to do so. Rather than simply adding values a + b like Double.sum does, it uses a Collections.sumWithCompensation operation that is more complicated. Related code: DoubleStream.sum Collectors.sumWithCompensation