File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
library/core/src/iter/traits Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -3493,9 +3493,8 @@ pub trait Iterator {
34933493 ///
34943494 /// Takes each element, adds them together, and returns the result.
34953495 ///
3496- /// An empty iterator returns the zero value of the type except in the event
3497- /// of summing primitive types that have negative zero values like f32 and f64.
3498- /// An empty iterator of these types will return the negative zero value.
3496+ /// An empty iterator returns the *additive identity* ("zero") of the type,
3497+ /// which is `0` for integers and `-0.0` for floats.
34993498 ///
35003499 /// `sum()` can be used to sum any type implementing [`Sum`][`core::iter::Sum`],
35013500 /// including [`Option`][`Option::sum`] and [`Result`][`Result::sum`].
You can’t perform that action at this time.
0 commit comments