Floating Point Representation
Learn how computers store numbers with a decimal point.
Introduction
Integers are positive and negative whole numbers. Real numbers include positive and negative whole numbers, but also include numbers which have a fractional part.
Numbers such as 0.735, 0.1, 4.0 and 32.15 are all real numbers.
The way in which computers store real numbers is similar to scientific notation.
Scientific Notation
Scientific notation is a method of writing very large or very small numbers in a more concise way.
A number is written in scientific notation when a number between 1 and 10 is multiplied by a power of 10.
For example,
74,000,000 can be written as…
7.4 x 107
Mantissa & Exponent
Computers use Floating Point Representation to store real numbers. This is similar to scientific notation.
The computer breaks the number down into two parts:
- Mantissa
- Exponent
For example,
0.174 x 106
The number will always start with 0. and at National 5 level will be followed by x 10x.
These 2 pieces of information are constants and therefore do not need to be stored everytime a computer remembers a number.
We need to store the parts that change!
The mantissa is the significant digits in the fractional part. i.e. the numbers after the decimal point.
The exponent is always the power.
In the example above, the mantissa is 174 and the exponent is 6.
Example
Identify the mantissa and exponent in the following number.
0.8349 x 103
Mantissa - 8349
Exponent - 3