Skip to main content

sum

Function sum 

Source
pub fn sum<T: Copy>(x: &[T]) -> (<Sum as Reduction<T>>::Total, bool)
where Sum: Reduction<T>,
Expand description

The sum of x, 0 for an empty slice, and whether it fits. An integer sum that doesn’t fit wraps.