@delroth_ UB, if I’m not mistaken. The short gets promoted to int for the left shift, and then you’re shifting one into the sign bit.
Integer promotion rules are probably the most important thing I don't understand in C/C++. int x = ((short)0xffff << 16) / 0x50ul; Guess x.
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.