Computer Chess Club Archives


Search

Terms

Messages

Subject: Binary question

Author: Severi Salminen

Date: 14:09:39 10/19/00


Hi!

Now I have my bitboard move generator online generating pawn and knight moves!
It works, great! One question:

How do I find n in a binary number 2^n? So f(1000b)=3? Now I just shift right:

c=0;
while(B>>++c) ;
c--;

Any ideas?

Severi



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.