This Question has been **Answered**

Featured Replies

- 1
If I have a number like `13`, its binary representation is `1101` (i.e., `13 = 8 + 4 + 1 = 1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0`). If I do a bitshift of the number to the left by one bit, … Read More

- 2
Each digit stands for a power of 2, just like decimal digits stand for a power of 10. For example, if you have a decimal number: 5498 5 4 9 8 5 * 10^3 + 4 * 10^2 + 9 * 10^1 + 8 * 10^0 5 * 1000 + … Read More

- 2
As their name implies, they *shift the bits* to the left or right. In other words, the bits are moved to the left or right by the given amount of positions. If I take the number 13, I get this: For left-shift: 13 == 1101 == 13 13 << 1 … Read More

- 2
It is easiest to understand what << and >> do when you consider a number as a binary value (which is where convertion between binary and decimal come into it). This is because these are bitwise operators (2 of several), that is when they operate they consider individual bits of … Read More

This question has already been answered. Start a new discussion instead.

Recommended Topics