Instance Methodswift 6.0.1Swift
wrappedSum
Returns the sum of the scalars in the vector, computed with wrapping addition.
func wrappedSum() -> Self.Scalar
Equivalent to indices.reduce(into: 0) { $0 &+= self[$1] }
.
Other members in extension
Type members
static var one: Self
A vector with one in all lanes.
static var zero: Self
A vector with zero in all lanes.
static func random(in: ClosedRange<Self.Scalar>
) -> Self Returns a vector with random values from within the specified range in all lanes.
static func random(in: Range<Self.Scalar>
) -> Self Returns a vector with random values from within the specified range in all lanes.
static func random<T>(in: ClosedRange<Self.Scalar>, using: inout T
) -> Self Returns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.
static func random<T>(in: Range<Self.Scalar>, using: inout T
) -> Self Returns a vector with random values from within the specified range in all lanes, using the given generator as a source for randomness.
static func % (a: Self.Scalar, b: Self
) -> Self static func % (a: Self, b: Self.Scalar
) -> Self static func % (a: Self, b: Self
) -> Self static func %= (a: inout Self, b: Self.Scalar
) static func %= (a: inout Self, b: Self
) static func & (a: Self.Scalar, b: Self
) -> Self static func & (a: Self, b: Self.Scalar
) -> Self static func & (a: Self, b: Self
) -> Self static func &* (a: Self.Scalar, b: Self
) -> Self static func &* (a: Self, b: Self.Scalar
) -> Self static func &* (a: Self, b: Self
) -> Self static func &*= (a: inout Self, b: Self.Scalar
) static func &*= (a: inout Self, b: Self
) static func &+ (a: Self.Scalar, b: Self
) -> Self static func &+ (a: Self, b: Self.Scalar
) -> Self static func &+ (a: Self, b: Self
) -> Self static func &+= (a: inout Self, b: Self.Scalar
) static func &+= (a: inout Self, b: Self
) static func &- (a: Self.Scalar, b: Self
) -> Self static func &- (a: Self, b: Self.Scalar
) -> Self static func &- (a: Self, b: Self
) -> Self static func &-= (a: inout Self, b: Self.Scalar
) static func &-= (a: inout Self, b: Self
) static func &<< (a: Self.Scalar, b: Self
) -> Self static func &<< (a: Self, b: Self.Scalar
) -> Self static func &<< (a: Self, b: Self
) -> Self static func &<<= (a: inout Self, b: Self.Scalar
) static func &<<= (a: inout Self, b: Self
) static func &= (a: inout Self, b: Self.Scalar
) static func &= (a: inout Self, b: Self
) static func &>> (a: Self.Scalar, b: Self
) -> Self static func &>> (a: Self, b: Self.Scalar
) -> Self static func &>> (a: Self, b: Self
) -> Self static func &>>= (a: inout Self, b: Self.Scalar
) static func &>>= (a: inout Self, b: Self
) static func / (a: Self.Scalar, b: Self
) -> Self static func / (a: Self, b: Self.Scalar
) -> Self static func / (a: Self, b: Self
) -> Self static func /= (a: inout Self, b: Self.Scalar
) static func /= (a: inout Self, b: Self
) static func ^ (a: Self.Scalar, b: Self
) -> Self static func ^ (a: Self, b: Self.Scalar
) -> Self static func ^ (a: Self, b: Self
) -> Self static func ^= (a: inout Self, b: Self.Scalar
) static func ^= (a: inout Self, b: Self
) static func | (a: Self.Scalar, b: Self
) -> Self static func | (a: Self, b: Self.Scalar
) -> Self static func | (a: Self, b: Self
) -> Self static func |= (a: inout Self, b: Self.Scalar
) static func |= (a: inout Self, b: Self
) static func ~ (a: Self
) -> Self