Skip to content

Commit 1093779

Browse files
Update library/core/src/iter/traits/iterator.rs
Co-authored-by: Jubilee <[email protected]>
1 parent a27547a commit 1093779

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

library/core/src/iter/traits/iterator.rs

+2-3
Original file line numberDiff line numberDiff 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`].

0 commit comments

Comments
 (0)