Vector.opBinary

Performs a binary operation on the vector.

struct Vector(T, char[] c)
typeof(this)
opBinary
(
string op
F
)
()
if (
op != "in"
)
if (
c.length > 1 &&
areValidCoordinates(c)
)

Parameters

value F

a number, a vector or an array with the same size

Return Value

Type: typeof(this)

the new vector

Examples

assert(vector(1, 1) - 1 == vector(0, 0));
assert(vector(10, 10) * vector(0, 9) == vector(0, 90));
assert(vector(16, 15) & [15, 3] == vector(0, 3));
assert(1 - vector(100, 0, -100) == vector(-99, 1, 101));

Meta