Saturday, March 2, 2013

How to extract bit ranges without using loop ?

How to extract bit range from an integer without using loop ?



lets see, how it will work for n = 27, i = 2, j = 6;



<< :  Left Shift Operator
>> : Right Shift Operator
&  : AND operator





0 comments:

Post a Comment