Instance Method

wrappedSum()

Returns the sum of the scalars in the vector, computed with wrapping addition.

Declaration

func wrappedSum() -> Scalar
Available when Scalar conforms to FixedWidthInteger.

Discussion

Equivalent to indices.reduce(into: 0) { $0 &+= self[$1] }.