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 {
3493
3493
///
3494
3494
/// Takes each element, adds them together, and returns the result.
3495
3495
///
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.
3499
3498
///
3500
3499
/// `sum()` can be used to sum any type implementing [`Sum`][`core::iter::Sum`],
3501
3500
/// including [`Option`][`Option::sum`] and [`Result`][`Result::sum`].
You can’t perform that action at this time.
0 commit comments