Hi team,
Below is an excerpt from a Bitwise chapter in Python:
Let’s suppose we have a binary number 0110 (6 in decimal). The operation we perform is 0110 >> 2
:
- 0110 >> 2
- 0011 (move one step to the right)
- 0001 (move one more step to the right)
- Operation complete
Similarly, we can move 0110 twice to the left with the following operation 0110 << 2
:
- 0110 << 2
- 01100 (move one step to the left)
- 011000 (move one more step to the left)
- Operation complete
So , I understood the Bitwise right , where to keep the size of the binary value, it is getting filled up by zeroes, when shifting to its right. But here, for the case of Bitwise left, I cannot see that its getting shfted to its left ut the zeroes are getting added up. Please help on this.
Thanks and Regards
Ankan
Course: Educative: Interactive Courses for Software Developers
Lesson: Educative: Interactive Courses for Software Developers