Numbers are stored in scientific notation. Thus, 423.5 becomes 0.4235·103, etc. However, the computer deals with fixed, binary word lengths, usually with 16, 32, 64 or more bits. Out of these bits, we must reserve one for the sign, a majority of the available bits for the mantissa or fraction part, and the remainder for the exponent or characteristic. The fraction part determines the accuracy of a number, the characteristic part the range of available digits.
A floating point number has the form
,
where the di are digits or bits ranging in value from 0 to B - 1, B being the base, i.e., 2, or 8, 16, etc., or 10, p the number of significant bits or digits, i.e., the precision, and e is the integer exponent which determines the range, i.e., B-e to B+e.
As a rule, numbers are normalized, i.e., the fractional part and the exponent are adjusted so that dl is non-zero. The number 0 is an exception; since, obviously, it cannot be normalized.
In your calculator, e seems to be 10, in a computer it will be 2, but a base 16 may also be used at some stages. Computers offer single. double and extended precision, i.e., 6 or 7, 13 or 14, 19 or 20 digits.
There are gaps in the numbers in a computer, in contrast to what happens in the real number system.
Let
![]()
Then all the normalized numbers will have the form
![]()
However, 102 = 1/2 and 112.= 1/2 + 1/4 = 3/4. Substituting for e, we find that the range of the numbers is
.
Hence all the positive numbers are
.
It is clear that these numbers are crowded near 0 and become sparser towards 6. The gaps between the numbers are not uniform! Moreover, there is no zero! It is specially defined in a computer and, of course, is not normalized.
A consequence of these gaps is that, for example, 2.3 will be stored as 2, indeed, all values between 2 and 3 will be stored as 2. Therefore, if we use for our algorithm too small a tolerance, we will get an infinite loop.
Note that you should have realized by now that one is often inclined in hand calculations to carry over meaningless digits. For example,
1/1.23 = 0.813 and not = 0.8130081.
The last result is given by your calculator.
last next