5
$\begingroup$

This question is inspired by How to round 0.4999... ? Is it 0 or 1? I didn't quite understand the logic of the answer. It seems you round every decimal place no matter how far back it goes? In the case of 0.49999, you're rounding up the 9 increases which causes the .4 to be .5 making it round up to 1 (rather than down).

So 0.45 will rounds to 1? Would .444444444444444444444444444449 also round to 1?

$\endgroup$
  • 9
    $\begingroup$ 0.4999.. doesn't go "up" or increase to 0.5. they are equal. $\endgroup$ – wim Oct 22 '12 at 1:51
10
$\begingroup$

I think your understanding of the reason why $0.499999\ldots$ ($=0.4\overline{9}$) rounds to $1$ is mistaken. The reason why $0.4\overline{9}$ rounds to $1$ is because it is equal to $0.5$, which rounds up.

However, $0.45$ unambiguously rounds down to $0$; indeed, any number in the range $-0.5 \le x < 0.5$ rounds to $0$.

$\endgroup$
  • 2
    $\begingroup$ (I changed "=$0.4\overline{9}$ to "$=0.4\overline{9}$". That is standard usage. Notice the difference in physical appearance. Putting things like this INSIDE of TeX is proper usage since the standard typesetting conventions are built in. $\endgroup$ – Michael Hardy Oct 21 '12 at 21:36
  • 3
    $\begingroup$ @MichaelHardy: Thanks. I'm surprised you noticed that, and not my assertion that 0.4999... rounds to 9! $\endgroup$ – Clive Newstead Oct 22 '12 at 7:33
  • $\begingroup$ Actually, if you read Hagen von Eitzen, you will see it is not as "unambiguous" as it may appear: E.g. $0.45$ rounds up to $0.5$, which rounds up to 1. How about rounding the number the OP asks about: $.444444444444444444444444444449$ How many places are you willing to round up to? If you allow rounding all digits up to the hundredths place to ($.45$), it's arbitrary whether to then round to the tenths place, to .05, and then to the integer 1. $\endgroup$ – amWhy Oct 17 '16 at 19:20
  • $\begingroup$ I'm not arguing with your answer, I just don't think your answer really addresses the OP's second question. $\endgroup$ – amWhy Oct 17 '16 at 19:25
11
$\begingroup$

You may be thinking of this: Rounding $0.4445$ or even $0.4449$ directly to an integer produces $0$. When rounding $0.4445$ to three decimal places, we round the 5 up and onbtain $0.445$. When we round this number again (to two decimal places), we obtain $0.45$, and if we round this to one decimal place, we obtain $0.5$, which we finally round to integer obtaining $1$ instad of $0$. Repeated rounding is to be avoided! There are rounding strategies that can cope better with repeated rounding ("round 5 to even") then the usual and conventional rounding rule ("round 5 up").

In other words: Rounding introduces error.

$\endgroup$
  • 2
    $\begingroup$ +1, only answer that actually understands the "0.45" rounding issue. $\endgroup$ – Matsemann Oct 22 '12 at 8:46
  • $\begingroup$ + Agreed! ${}{}{}{}$ $\endgroup$ – amWhy Oct 17 '16 at 19:26
8
$\begingroup$

The distance from $0.45$ to $0$ is $0.45$ and the distance from $0.45$ to $1$ is $0.55$, which is bigger. So in order to round to the nearest integer, you'd round to $0$.

Sometimes a bias in favor of being too big is desirable: If you're laying a cable across the floor of the San Francisco Bay from SF to Oakland, and it's too short, you lose everything, but if it's too long, you lose only the cost of the excess cable.

$\endgroup$
2
$\begingroup$

It is definitely 0, since it is less than 0.5. But in these cases i would not round to 0, since it might make the solution meaningless. It all depends from the problem's scope and you instructor (or the environment).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy