Rounding - Double Rounding

Double Rounding

Rounding a number twice in succession to different precisions, with the latter precision being coarser, is not guaranteed to give the same result as rounding once to the final precision except in the case of directed rounding. For instance rounding 9.46 to one decimal gives 9.5, and then 10 when rounding to integer using rounding half to even, but would give 9 when rounded to integer directly.

In the cases in the US from 1995 to 1997 of Martinez versus Allstate and Sendejo versus Farmers the insurance companies argued that double rounding premiums was permissible and in fact required. The cases were decided against the insurance companies and they were ordered to adopt rules to ensure single rounding.

Some computer languages and the IEEE 754-2008 standard dictate that in straightforward calculations the result should not be rounded twice. This has been a particular problem with Java as it is designed to be run identically on different machines, special programming tricks have had to be used to achieve this with x87 floating point. The Java language was changed to allow different results where the difference does not matter and require a strictfp qualifier to be used when the results have to conform accurately.

Read more about this topic:  Rounding

Famous quotes containing the words double and/or rounding:

    The Cossack eats Poland,
    Like stolen fruit;
    Her last noble is ruined,
    Her last poet mute:
    Straight, into double band
    The victors divide;
    Half for freedom strike and stand;—
    The astonished Muse finds thousands at her side.
    Ralph Waldo Emerson (1803–1882)

    The past absconds
    With our fortunes just as we were rounding a major
    Bend in the swollen river; not to see ahead
    Becomes the only predicament when what
    Might be sunken there is mentioned only
    In crabbed allusions but will be back tomorrow.
    John Ashbery (b. 1927)