Skip to main content

sum

Function sum 

Source
pub fn sum<T>(x: &[T]) -> (<Sum as Reduction<T>>::Total, bool)
where T: Copy, 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.