Lies My Calculator
and Computer Told Me
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Lies My Calculator and Computer Told Me
●
●
●
●
●
●
●
●
A wide variety of pocketsize calculating devices are currently marketed. Some can
run programs prepared by the user; some have preprogrammed packages for fre
quently used calculus procedures, including the display of graphs. All have certain
limitations in common: a limited range of magnitude (usually less than
for cal
culators) and a bound on accuracy (typically eight to thirteen digits).
A calculator usually comes with an owner’s manual. Read it! The manual will tell
you about further limitations (for example, for angles when entering trigonometric
functions) and perhaps how to overcome them.
Program packages for microcomputers (even the most fundamental ones, which
realize arithmetical operations and elementary functions) often suffer from hidden
flaws. You will be made aware of some of them in the following examples, and you
are encouraged to experiment using the ideas presented here.
Preliminary Experiments with your Calculator or Computer
To have a first look at the limitations and quality of your calculator, make it compute
. Of course, the answer is not a terminating decimal so it can’t be represented
exactly on your calculator. If the last displayed digit is 6 rather than 7, then your cal
culator approximates
by truncating instead of rounding, so be prepared for slightly
greater loss of accuracy in longer calculations.
Now multiply the result by 3; that is, calculate
. If the answer is 2, then
subtract 2 from the result, thereby calculating
. Instead of obtaining
0 as the answer, you might obtain a small negative number, which depends on the con
struction of the circuits. (The calculator keeps, in this case, a few “spare” digits that
are remembered but not shown.) This is all right because, as previously mentioned, the
finite number of digits makes it impossible to represent
exactly.
A similar situation occurs when you calculate
. If you do not obtain 0,
the order of magnitude of the result will tell you how many digits the calculator uses
internally.
Next, try to compute
using the
key. Many calculators will indicate an error
because they are built to attempt
. One way to overcome this is to use the fact
that
whenever
is an integer.
Calculators are usually constructed to operate in the decimal number system. In
contrast, some microcomputer packages of arithmetical programs operate in a number
system with base other than 10 (typically 2 or 16). Here the list of unwelcome tricks
your device can play on you is even larger, since not all terminating decimal numbers
are represented exactly. A recent implementation of the BASIC language shows (in
double precision) examples of incorrect conversion from one number system into
another, for example,
whereas
Yet another implementation, apparently free of the preceding anomalies, will not
calculate standard functions in double precision. For example, the number
, whose representation with sixteen decimal digits should be
,
appears as
This is the end of the preview.
Sign up
to
access the rest of the document.
 Winter '08
 JaberAbdualrahman
 Mean Value Theorem, Taylor Series, Decimal

Click to edit the document details