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. ScalarFixedWidthIntegerに準拠する場合に利用可能です。

Discussion 解説

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