[Haskell-cafe] Why 'round' does not just round numbers ?
ok at cs.otago.ac.nz
Mon Oct 27 22:00:27 EDT 2008
On 28 Oct 2008, at 11:11 am, Henning Thielemann wrote:
> In measured data the .5-case should be very rare - a "null set"?
> However I assume that .5 happens more often in practice - because of
> prior rounding,
Think about money.
When I was a child, farthings (1/4 of a penny) had just been
dropped. (By now, our smallest coin is 10c, formerly a shilling,
so in ~ 50 years the value of the smallest coin has eroded by a
factor of 48.) Ha'pennies (1/2 of a penny) were still around.
If you were adding up a sum of money, sums ending with 1/2 were
actually quite common. When the ha'penny went the way of the
farthing, one still had to round sums in pounds shillings and
pence to sums in pounds and shillings, and sixpence (0.5 of a
shilling) was not an unlikely amount.
Now that the smallest coin is 10c, supermarkets still price
things in multiples of 1c, so in order to give change, they
have to round to a multuple of 10c. Sums that end with 5c
are not at all unusual.
Considering that the point of the thread is "what should we
expect rounding to do", it may be of interest that a couple of
years after the death of the 5c piece, supermarkets *still*
display their rounding rule at the cash registers.
More information about the Haskell-Cafe