| | | | | |

Implementing BitVector - 1

size_t BitVector::ByteNumber (size_t index) const
{
  // return index / 8
  // shift right 3 is equivalent to, and faster than, dividing by 8
}

unsigned char BitVector::Mask (size_t index) const
{
  // return mask for index % 8
  // the low order 3 bits is the remainder when dividing by 8
}

| | Top of Page | 7. A BitVector Class - 9 of 14