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

Janis Voigtlaender voigt at tcs.inf.tu-dresden.de
Mon Oct 27 06:30:36 EDT 2008


Felipe Lessa wrote:
> On Mon, Oct 27, 2008 at 8:15 AM, Janis Voigtlaender
> <voigt at tcs.inf.tu-dresden.de> wrote:
> 
>>That is of course true (and was the topic of heated discussion with my
>>fourth grade math teacher), but does not explain 2.5 -> 2.
> 
> 
> If you round to odd instead of round to even, then 4.5 rounds to 5,

Well, of course I did not learn to round to odd. I learned to round .5
to above, but not to do repeated rounding.

So we would never have either of

> 2.45 -> 2.4 -> 2
> 2.45 -> 2.5 -> 3

as you suggest.

Instead, always in one go:

2.45 -> 2

Because of the 4, whereas any digit following it would be ignored:

2.4x -> x

In fact, by your explanation, you would have:

3.46 -> 3.5 -> 4

Which is most odd. 3.46 is definitely closer to 3 than to 4.

-- 
Dr. Janis Voigtlaender
http://wwwtcs.inf.tu-dresden.de/~voigt/
mailto:voigt at tcs.inf.tu-dresden.de



More information about the Haskell-Cafe mailing list