Quote:That << is raising a power essentially.
Not quite. 2x only applies if the left operand is 1. As stated it's an arithmetic shift left. Take for instance
3 << 2
3 in binary notation is 11. << 2 now means shifting these bits to the left, and filling the right ones with zeroes.
112 << 2 == 11002 == 12 == 3 * 4
a << x is therefore the same like a * 2x.
To clarify: See what happens if you do a shift left with decimals:
3 << 2 == 300 (in decimals) (Edit: typo)
Get familiar with binaries, it's a must for a developer [smile]
[Edited by - unbird on August 26, 2010 9:31:25 AM]