What is this: cout << (y>>2)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
5th Apr 2019, 2:58 PM
Alireza Abbasi
Alireza Abbasi - avatar
2 Answers
+ 7
>> 2 is a bitwise right shift by 2 positions. It's effectively the same as an integer division by 4: 0b00010001 (17) >> 1: 0b00001000 (8, trailing -1 is lost) >> 1: 0b00000100 (4)
5th Apr 2019, 3:07 PM
Anna
Anna - avatar
0
thanks Anna. this code is a good explain too. https://code.sololearn.com/c3btxo5900gg/?ref=app
6th Apr 2019, 12:49 AM
Alireza Abbasi
Alireza Abbasi - avatar