We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a27547a commit 1093779Copy full SHA for 1093779
library/core/src/iter/traits/iterator.rs
@@ -3493,9 +3493,8 @@ pub trait Iterator {
3493
///
3494
/// Takes each element, adds them together, and returns the result.
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.
+ /// An empty iterator returns the *additive identity* ("zero") of the type,
+ /// which is `0` for integers and `-0.0` for floats.
3499
3500
/// `sum()` can be used to sum any type implementing [`Sum`][`core::iter::Sum`],
3501
/// including [`Option`][`Option::sum`] and [`Result`][`Result::sum`].
0 commit comments