intersection(set)/bitAnd(&)

Syntax

X & Y

Arguments

Set Operation: X and Y are sets.

Bit Operation: X and Y are equal sized vectors,or Y is a scalar.

Details

Set Operation: return the intersection of two sets.

Bit Operation: return the result of bitAnd operation.

Examples

// set intersection
$ x=set([5,5,3,4]);
$ y=set(8 9 4 4 6);
$ x & y;
set(4)

// bitAnd
$ x=1 0 1;
$ y=0 1 1;
$ x&y;
[0,0,1]