(z *BigInt, x *BigInt, i int, b uint)
| 1869 | } |
| 1870 | |
| 1871 | func altSetBit(z *BigInt, x *BigInt, i int, b uint) *BigInt { |
| 1872 | one := NewBigInt(1) |
| 1873 | m := one.Lsh(one, uint(i)) |
| 1874 | switch b { |
| 1875 | case 1: |
| 1876 | return z.Or(x, m) |
| 1877 | case 0: |
| 1878 | return z.AndNot(x, m) |
| 1879 | } |
| 1880 | panic("set bit is not 0 or 1") |
| 1881 | } |
| 1882 | |
| 1883 | func testBitset(t *testing.T, x *BigInt) { |
| 1884 | n := x.BitLen() |
no test coverage detected
searching dependent graphs…