Or computes the logical OR of two bit arrays. The caller must ensure they have the same bit size.
(lhs, rhs BitArray)
| 442 | // Or computes the logical OR of two bit arrays. |
| 443 | // The caller must ensure they have the same bit size. |
| 444 | func Or(lhs, rhs BitArray) BitArray { |
| 445 | res := lhs.Clone() |
| 446 | for i, w := range rhs.words { |
| 447 | res.words[i] |= w |
| 448 | } |
| 449 | return res |
| 450 | } |
| 451 | |
| 452 | // Xor computes the logical XOR of two bit arrays. |
| 453 | // The caller must ensure they have the same bit size. |