teach-ict.com logo

THE education site for computer science and ICT

1. Introduction

An integer is one of the primitive data types (separate section here).

An integer is used to represent a whole number, one that does not have any fractional part.

There are two general storage sizes for the integer, either two bytes (short int) or four bytes (long int).

They can also be signed or unsigned.

Two methods are used to represent signed numbers, these are

  • Sign & Magnitude
  • Two's compliment

This section describes these features in detail.