   C# Bitshift
  I've decided to have a go at some C# programming, and I'm trying to do the following :ulong bitshift = (8 * vertical) + horizontal;return 1uL << bitshift;However I am getting the following error :Operator '<<' cannot be applied to operands of type 'ulong' and 'ulong'Can anyone explain why this operation is not allowed please?   
  The second operand for << must be an int. That's just the way it is.   ;  I can live with that. Thanks!   ;  Out of curiosity how does C#, Java and the other managed and/or "portable" languages handle out-of-range or negative shift counts?In C/C++ they do whatever the processor does natively of course, so typically mod 32/64 shifts I suppose.   ;  In C#, if the first operand is signed, then the second operand is anded with 0x1F and the first operand is shifted that many places. If the first operand is unsigned, then the second operand is anded with 0x3F and the first operand is shifted that many places. I don't know how Java handles it.   ;  Python (at least up to 2.6; P3K may do something different) raises a ValueError if the shift is negative, and an OverflowError if the shift amount is too large to fit in an int. However, it does not care if you shift by 32 or more bits; the result is simply promoted to 'long' (which in Python is actually a bignum type).'1 << (1 << 31 - 1)' is a good way to hang up the Python prompt ;)   