Hello
I was reading a program today and I saw this sign "<<" what does that mean?
Code:x = number / (1 << y);
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.
Last edited by hk_mp5kpdw; 11-02-2007 at 07:05 AM.
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
Assuming that "number" and "x" are both integers, I would think that "x >> y" would achieve the same thing, but quicker.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.