let bw_and v1 v2 =
let l = v1.length in
if l <> v2.length then invalid_arg "Bitv.bw_and";
let b1 = v1.bits
and b2 = v2.bits in
let n = Array.length b1 in
let a = Array.create n 0 in
for i = 0 to n - 1 do
a.(i) <- b1.(i) land b2.(i)
done;
{ length = l; bits = a }