Signed and Unsigned Integers

Promoting a signed integer type to another signed integer type of greater size requires signextension. In two's-complement representation, the bit pattern is unchanged, except for filling the high-order bits with copies of the sign bit.

When converting a signed integer type to an unsigned inter type, if the destination has equal or greater size, the first signed extension of the signed integer type is performed. If the destination has a smaller size, the result is the remainder on division by a number, one greater than the largest unsigned number, that is represented in the type with the smaller size.