Hello to all expert, i would like to square a number using bit operation since bit twiddling is quite important.
AFAIK, 33 & 1 will yields 1 to get its least significant digits.
How to check second or third least digit towards most significant digit ?
Example:
Any hints or reference is greatly appreciated by me ?2 * 2
0000 0010
0000 0010
The digit of 1 & 1 result 1 so left shift 1 digit but when 3 *2 is totally difference
0000 0010
0000 0011
0000 0110
Thanks.


Reply With Quote
Bookmarks