Bitwise oprators

can there be any other approach for counting the set bits between two no. apart from one in which we would iterate thre no. and count the set bits