John (Eljay) Love-Jensen wrote: > Also be aware that if your "1 << 31" goal is to set the high bit, then your > code is not portable. If the platform has 64-bit int, you will instead be > setting a middle bit. If the platform has 16-bit int, such a shift is > undefined behavior. Isn't it UB on a 32-bit machine as well? Looks like integer overflow to me. Andrew.