Hello
I was reading a program today and I saw this sign "<<" what does that mean?
Code:x = number / (1 << y);
Printable View
Hello
I was reading a program today and I saw this sign "<<" what does that mean?
Code:x = number / (1 << y);
bitwise shift left, i.e. 1 << 3 = 00000001 << 3 = 00001000 = 8; 5 << 2 = 00000101 << 2 = 00010100 = 20.
Assuming that "number" and "x" are both integers, I would think that "x >> y" would achieve the same thing, but quicker.
--
Mats