Although it may not seem so to the beginner, it is important to examine ways in which numbers are represented.
To five significant digits (5S ), 2/3 is represented by 0.66667, by 3.1416, and by 1.4142. None of these are exact representations, but all are correct to within half a unit of the fifth significant digit. Numbers should normally be presented in this sense, correct to the number of digits given.
If the numbers to be represented are very large or very small, it is convenient to write them in floating point notation (for example, the speed of light 2.99792 x m/s, or the electronic charge 1.6022 x coulomb). As indicated, we separate the significant digits (the mantissa) from the power of ten (the exponent); the form in which lhe exponent is chosen so that the magnitude of the mantissa is less than 10, but not less than 1 is referred to as the scientific notation.
In 1985,the Institute of Electrical and Electronics Engineers published a standard for binary floating point arithmetic. This standard, known as the IEEE Standard 754, has been widely adopted (it is very common on workstations used for scientific computation). The standard specifies a format for `single precision' numbers and a format for `double precision' numbers. The single precision format allows 32 binary digits (known as bits) for a floating point number with 23 of these bits allocated to the mantissa. In the double precision format the values are 64 and 52 bits, respectively. On conversion from binary to decimal, it turns out that any IEEE Standard 754 single precision number has an accuracy of about six or seven decimal digits, and a double precision number an accuracy of about 15 or 16 decimal digits.
The simplest way of reducing the number of significant digits in the representation of a number is merely to ignore the unwanted digits. This procedure, known as chopping, was used by many early computers. A more common and better procedure is rounding, which involves adding 5 to the first unwanted digit and then chopping. For example, chopped to four decimal places (4D ), is 3.1415, but it is 3.1416 when rounded; the representation 3.1416 is correct to five significant digits (5S). The error involved in the reduction of the number of digits is called round-off error. Since is 3.14159.. , we note that chopping has introduced much more round-off error than rounding.
Numerical results are often obtained by truncating an infinite series or iterative process (cf. STEP 5). Whereas round-off error can be reduced by working to more significant digits, truncation errors can be reduced by retaining more terms in the series or more steps in the iteration; this, of course, involves extra work (and perhaps expense!).
The following example illustrates rounding to four significant digits (4S):
5/3 = 1.66666...
determine the magnitude of the round-off error when it is represented by a number obtained from the decimal form by: