Is there a nice way to split an int into two shorts (.NET)?
This can certainly be done with no loss of information. In both cases you end up with 32 bits of information. Whether they’re used for sign bits or not is irrelevant: int original = …; short firstHalf = (short) (original >> 16); short secondHalf = (short) (original & 0xffff); int reconstituted = (firstHalf << 16) … Read more