Loss of Significance - Demonstration of The Problem

Demonstration of The Problem

The effect can be demonstrated with decimal numbers. The following example demonstrates loss of significance for a decimal floating-point data type with 10 significant digits:

Consider the decimal number

0.1234567891234567890

A floating-point representation of this number on a machine that keeps 10 floating-point digits would be

0.1234567891

which is fairly close – the difference is very small in comparison with either of the two numbers.

Now perform the calculation

0.1234567891234567890 − 0.1234567890

The answer, accurate to 10 digits, is

0.0000000001234567890

However, on the 10-digit floating-point machine, the calculation yields

0.1234567891 − 0.1234567890 = 0.0000000001

Whereas the original numbers are accurate in all of the first (most significant) 10 digits, their floating-point difference is only accurate in its first nonzero digit. This amounts to loss of significance.

Read more about this topic:  Loss Of Significance

Famous quotes containing the words the problem and/or problem:

    In a town-meeting, the great secret of political science was uncovered, and the problem solved, how to give every individual his fair weight in the government, without any disorder from numbers. In a town-meeting, the roots of society were reached. Here the rich gave counsel, but the poor also; and moreover, the just and the unjust.
    Ralph Waldo Emerson (1803–1882)

    The thinking person has the strange characteristic to like to create a fantasy in the place of the unsolved problem, a fantasy that stays with the person even when the problem has been solved and truth made its appearance.
    Johann Wolfgang Von Goethe (1749–1832)