Hi,

is anunsignedintegral typenegative, and asignedintegral typepositive? Or is it the exact opposite? There was some confusion on which is which in the book I'm reading.

Printable View

- 12-22-2009Programmer_PUnsigned vs. Signed?
Hi,

is an**unsigned**integral type**negative**, and a**signed**integral type**positive**? Or is it the exact opposite? There was some confusion on which is which in the book I'm reading. - 12-22-2009laserlight
unsigned implies that the possible values are non-negative; signed implies that the possible values can be negative.

- 12-22-2009slingerland3g
Note that the MSB of the signed value is used to define if the value is negative or positive, also the value stored for signed types is cut in half to those values stored in an unsigned storage type. Food for thought.

- 12-22-2009Programmer_P
Ok, thanks. One more question:

Are all basic types, such as int, char, etc.**signed**by default? - 12-22-2009laserlightQuote:

Originally Posted by**Programmer_P**