Search code examples
memoryunsignedsignedrepresentation

How is unsigned int/long represented


I was reading some assembly tutorial in which there were explained the signed integers and the unsigned integers and the difference between their representation in computer memory.

I remember something like that there was some bit at the beginning at the number so it tells whether the integer is unsigned or signed.

If someone knows it, please answer.


Solution

  • Wikipedia's page on Signed Number representation shows the most common memory implementations of both signed and unsigned integer values.

    Two's complement is the most common representation.