This is an old revision of the document!
An integer is a number that has no fractional component, so 2, 6, -15, and 17356 are all considered integers, while 13½, -1/12, π, and 5.2 are not. For our use, we split integers into 2 categories, signed and unsigned. A signed integer is any whole number, negative or positive, while an unsigned integer is a strictly positive whole number (and zero).
Each of the data value types has an associated size, ranging from 1 byte (8 bits) to 32 byte (256 bits), so the length of the number in binary will be given based on the type. For example:
unsigned int: 4 bytes 0000000000000000000000000000000 unsigned half int: 2 bytes 0000000000000000
Whether or not the data type is signed changes how the first bit of the number interacts with the rest, in a signed number the first bit acts as a positive or negative sign For example:
signed half half int 1 Byte Binary: 10000000 Decimal: -128 Binary: 00000000 Decimal: 0
For further information on how negative act in binary try looking here:
https://en.wikipedia.org/wiki/Two%27s_complement
Each place value in binary is worth double the previous
Ex: 1 1 1 1 Is worth 8 4 2 1
To convert a binary number to decimal, just add each place value Ex:
11010010 (1*128)+(1*64)+(0*32)+(1*16)+(0*8)+(0*4)+(1*2)+(0*1) =210