And computes the logical AND of two bit arrays. The caller must ensure they have the same bit size.
(lhs, rhs BitArray)
| 418 | // And computes the logical AND of two bit arrays. |
| 419 | // The caller must ensure they have the same bit size. |
| 420 | func And(lhs, rhs BitArray) BitArray { |
| 421 | res := lhs.Clone() |
| 422 | for i, w := range rhs.words { |
| 423 | res.words[i] &= w |
| 424 | } |
| 425 | return res |
| 426 | } |
| 427 | |
| 428 | // Or computes the logical OR of two bit arrays. |
| 429 | // The caller must ensure they have the same bit size. |