[Haskell-cafe] Why 'round' does not just round numbers ?

Daniel Fischer daniel.is.fischer at web.de
Mon Oct 27 07:17:43 EDT 2008


Am Montag, 27. Oktober 2008 11:46 schrieb Henning Thielemann:
> On Mon, 27 Oct 2008, Janis Voigtlaender wrote:
> > Henning Thielemann wrote:
> >> I think one reason is that repeated rounding should not be worse than
> >> rounding in one go. Consider the rule 'use ceiling when the first
> >> removed digit is 5'. Then
> >>
> >> 0.45 - (round to one place) -> 0.5 - (round to integer) -> 1
> >
> > But repeated rounding *is* worse than rounding in one go, under any
> > reasonable scheme:
> >
> > 3.46 -> 3.5 -> 4
>
> With the rounding-to-even route this would be
>
> 3.46 -> 3.4 -> 3

Wait, that cannot be. 6 > 5, so 3.46 -> 3.5 even with banker's rounding.

>
> so rounding in passes is no worse than rounding in one go for this
> example.

Rounding in passes is bad per se, because there are pretty large intervals 
where that gives a different result from a direct rounding.
>
> > vs.
> >
> > 3.46 -> 3
> >
> > That was actually the debate with that teacher. Unbelievable as that
> > still is to me today, she advocated the 3.46 -> 3.5 -> 4 route ...
>
> I also know a didact which tells teachers that 1 has no prime
> decomposition. Oh, I see, she may have copied that from Wikipedia:
>     http://en.wikipedia.org/wiki/Prime_factorisation

I can believe that makes sense to somebody who considers 0 an unnatural 
number, an empty product must be frightening for them.



More information about the Haskell-Cafe mailing list