[Test] public void BitIndex() { const string bitstr0 = "100100010100110010110"; var bits0 = Bit.Parse(bitstr0); Assert.Equal(8, Bit.BitIndex(bits0, 4)); Assert.Equal(13, Bit.BitIndex(bits0, 6)); Assert.Equal(-1, Bit.BitIndex(bits0, 11)); }