Checking Computer Accuracy

See all articles from Sinc-Link v2 n4
Author(s): Bill White
Publication: Sinc-Link
Pub Details: Sinc-Link v2 n4 (Volume 2, Issue 4)
Pages: 1-2

An article in the April issue of SCIENTIFIC AMERICAN gives a method for determining the calculating precision level of a computer or calculator. The procedure is to enter 1.0000001 and square it 27 times. The correct result is, to ten digits.

674,530.4707

but most machines will be wrong.

All calculators can usually have the first three digits correct so that the per cent error is under 0.1. Unfortunately, most computers are a rather sad lot when tested on this method. These are some of the results:

COMPUTER           RESULT       %ERROR
--------           ------       ------
Apple II Basic      22723.9709    96.6
IBM PC Basic       8850273.      1212.
Ontel Basic        8886690       1217.
ZX-81 Basic         710493.46       5.3

The comparison with these others, makes our little “toy” look like a giant. So don’t knock it!

The program I used to test the ZX-81, which listed the numbers as they were calculated is:

10  INPUT A
20 FOR B = 1 TO 27
30 LET C = A ** 2
40 PRINT C;" ";
50 LET A = C
60 NEXT B

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.