 |
Ask A Scientist©
Computer Science Archive
|
 |
Floating Point Accuracy
Index Key: CSI006
Author: Danlee
Subject: Floating Point Accuracy
Text: Given double precision an IEEE double precision floating point
calculation, is there anything thing that can be said in general about round-
off error? For example, given N multiplications and N additions, is there
some limit on N below which one can expect, say, seven decimal digits of
accuracy?
Response #: 1 of 1
Author: mooney
Text: It is hard to say anything useful in general terms, because the
effect of round-off error depends very strongly on the relative sizes of the
things you are operating on. Here is the nutshell: Floating point numbers are
stored as a number and an exponent, so very large and very small numbers can
be stored with equal accuracy (up to a point that depends on how many bits are
allocated to the exponent). To ADD two numbers, however, they must first be
converted so that they have the same exponent. If the exponents differ by N,
you lose N bits of precision somewhere. If you have a very large number and a
very small one, you can lose ALL of the smaller number in a single addition.
NEWTON is an electronic community for Science, Math, and Computer Science K-12 Educators.
Argonne National Laboratory, Division of Educational Programs, Harold Myron, Ph.D., Division Director.