method iter.sum
Sum of the elements (pulls them all); panics on overflow like +.
Example:
fn main() io {
let xs: List<f64> = [1.5, 2.5, 4.0]
print("{xs.iter().sum()}")
}Output
8.0
pub(api) move fn sum() -> f64Complexity. O(n); pulls every element.
Since. 1.0.0-beta
Returns
f64
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter_numbers.oxl:535