A) (Int32)X | ((Int32)Y << 16);
B) (Int32)X + (Int32)Y * (Int32)Int16.MaxValue;
Shouldn't both be equivalent? I know from testing that the first works as expected, but for some reason the second doesn't. Both X and Y are shorts (Int16), and the return type is an integer (Int32).
Shouldn't Y << 16 <=> Y * Int16.MaxValue?