meta data for this page
  •  

This is an old revision of the document!


INT type variables

In the case of the INT, which is the integer type, the definition becomes slightly more complex in terms of formal constraints because of the introduction of the sign bit. This means that the highest value of the variable's position, the first bit on the left, will represent the sign: if it is “1”, the variable indicates a negative number, whereas if it is “0”, it indicates a positive one.

Really, just for the sake of completeness; in the case of negative numbers, the program uses the so-called “two's complement” conversion. That is, it first negates all the bits of the numerical value, i.e., it converts 0 to 1, and vice versa, converts 1 to 0, and then adds one to the resulting value. This conversion means that the negative value cannot be read directly from the bit combination unless the conversion is performed again in the opposite direction.
two's complement by INT