An integer is a term from mathmatics. Integers include all rational numbers that do not include decimals, as well as zero. In other words: ...,-2,-1,0,1,2,... Here, as in all programming, decimal numbers are handled differently than integers.
Note, that integers are different from whole numbers in that integers may be both positive and negative. Whole numbers include all positive values that do not include decimals, as well as zero. The range of natural numbers are all positive values without decimals excluding zero.
In programming, there are several different kinds of integers. The difference is in the amount of memory each one takes up. The first bit indicates if the value is positive or negative. Note that all the sizes given below refer to the R4300i processor.
- A byte (8bit) is an integer ranging from -128 to 127. In hexadecimal it is written 0x80 to 0x7F
- A short (16bit), or sometimes called a halfword, is two bytes long. It ranges in value from -32768 to 32767, or in hex 0x8000 to 0x7FFF.
- A word is four bytes long (32bit). It ranges from -2147483648 to 2147483647, or 0x80000000 to 0x7FFFFFFF.
- A doubleword is somewhat uncommon and totals eight bytes (64bit). It ranges from -9223372036854775808 to 9223372036854775807, or 0x8000000000000000 to 0x7FFFFFFFFFFFFFFF.