Vec2 a = [1, 2]; assert(1 + a == [1f + 1f, 1f + 2f]); assert(1 - a == [1f - 1f, 1f - 2f]); assert(2 * a == [2f * 1f, 2f * 2f]); assert(2 / a == [2f / 1f, 2f / 2f]); assert(2 % a == [2f % 1f, 2f % 2f]); assert(2 ^^ a == [2f ^^ 1f, 2f ^^ 2f]); Vec2i b = [1, 2]; assert((1 & b) == [1 & 1, 1 & 2]); assert((1 | b) == [1 | 1, 1 | 2]); assert((1 ^ b) == [1 ^ 1, 1 ^ 2]);
Returns a new vector with binary operator applied to all elements and scalar