Empty list sums to 0 or -0?
Closed this issue · 2 comments
bakkot commented
-0 is in some sense more correct, at least if you're thinking about floats: -0 is the additive identity for floats. On the other hand, this is supposed to be approximating real-number arithmetic as closely as possible, and reals do not have -0.
As a datapoint, in Python fsum([])
gives 0, not -0.
michaelficarra commented
I prefer -0
.
bakkot commented
-0
it is.