Numbers
All data that is processed by a computer is stored within the computer
system as binary numbers. It may seem odd therefore that there is any need to
mention the ways in which computers process numbers. However, just as a picture
or a sound must be coded for use in a computer system, so must numerical
data.
Computers deal with two types of numerical data called integer and real.
An integer number is restricted to whole number values between certain set
ranges. The range of integer allowed depends on how many bytes of storage are
used to represent the number. Integer arithmetic is fast and accurate as long
as the restricted range is not exceeded.
Real or floating point numbers allow fractional values but only
represent these values approximately. Floating point arithmetic has a much
increased range over integer arithmetic but it is slower, and requires more
storage space. Accuracy can be a problem.
In systems where fractional values are needed but where accuracy and
speed are also important then special representations may be used. One example
of this is financial systems that use a special format to store currency
values.
There is a great deal that I would have liked to include here but I have tried to stick strictly to the syllabus..
|