next up previous contents
Next: Vector coercion operator Up: Vectors and vector operators Previous: The concatenation operator   Contents

Extension of operators to vectors

Logical operators extend to vectors in the obvious way, by applying them one-by-one to the elements of the vector. That is, if f is a unary operator, then

        f[x,y] = [f(x),f(y)]
For example,

        ~[0,1,0] = [1,0,1]
Binary logical operators extend similarly. That is, if * is a binary operator, then

        [w,x] * [y,z] = [w*y, x*z]
For example,

        [0,1] & [1,1] = [0,1]



2002-10-28