Hi Facundo, > I expect to get a 1 in the s-th bit of a, and zeroes in all other > bits. I don't know why you say that's an arithmetic overflow, if > unsigned long long is 64 bits long and it has a 63-th bit (the last > one). You are not dealing with an unsigned long long that is 64-bits. You are dealing with a signed int that is 32-bits. Shifting a number by an amount equal-to-or-greater-than its bitsize has undefined behavior. --Eljay