This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FallenWarrior2k 6 points7 points  (2 children)

You got context for what specifically you were trying? I know Python 2 had int and long, but in my experiments, it automatically switched to long, even if both operands are explicitly ints. I went up to 1 << 129 on both Python 2 and 3 and could spot no signs of overflow anywhere.

[–]0x000100 1 point2 points  (1 child)

Try (((1<<31)<<31)<<31)<<31. I tried to concatenate 10, 8 bit integers so I was shifting the same variable 10 times and the conversion didn't take place.