Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
<< is the left shift operator which works on numbers in their binary form. 5 is 101 in binary, and the left shift moves the numbers to the left, adding a 0 to the right. 5 << 1 is 101 << 1 = 1010 So 5 << 2 is 101 << 2 = 10100 = 20
2nd Nov 2020, 6:51 PM
Russ
Russ - avatar