Knuth の Art of Computer Programing の 4巻の二進数の演算はためになる。