what is an unsigned integer?

Printable View

- 06-14-2002Sektisimple question
what is an unsigned integer?

- 06-14-2002Vicious
:eek:

umm.. its an unsigned integer....

meaning... un-negative, positive only...

so if you call a unsigned int and its value is less than 0 it will say 0 instead of -(number here) - 06-14-2002Prelude
>what is an unsigned integer?

An integer that cannot hold negative values, so instead of spanning a certain length into the negative field and a certain length into the positive field, an unsigned integer uses all of its bits for positive values. For example:

On my system, the max and min values of a signed integer are 2147483647 and -2147483648, respectively. The max and min values of an unsigned integer are 4294967295 and 0. In the unsigned version, all of the bits are used for a positive value and thus can have a higher value than a signed int.

-Prelude