1
$\begingroup$

For a typical rounding algorithm, I'm wondering how long the rounding chain goes for when you round up a number. For example, if you have a decimal like 0.4445, you round the last 5 up, which would round it to 0.4450, which would round it to 0.4500, which would round it to 0.5000, which would round to 1.0000? Or does the rounding stop after the initial rounding?

$\endgroup$
3
$\begingroup$

The purpose of rounding is typically to give a number to a certain number of significant digits. This is never done in such a chain as in your example. Let me try to elucidate why:

So we are given a number $0.4445$. Now if we were to round this to three decimal places we would indeed get $0.445$. Rounding the resulting number to two places gives $0.45$. However this does not represent the rounding of the original number, $0.4445$ to two places, for that would be $0.44$.

So rounding successively has no real meaning. An even more obvious example than the one above is that successive rounding of $0.4445$ yields $1$, whereas rounding the number to the ones place initially gives $0$.

Basically, don't ever round successively.

| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ This doesn't answer the question. The question is about how many iterations it takes for a particular rounding algorithm to terminate. $\endgroup$ – Jack M Jul 6 '14 at 0:07
  • $\begingroup$ @jack right. Maybe my question isn't clear enough $\endgroup$ – Growler Jul 6 '14 at 0:31
  • $\begingroup$ My apologies, I didn't gather that from the question, I took it to ask how many times should one round. Sorry about that $\endgroup$ – user155385 Jul 6 '14 at 0:31
  • $\begingroup$ @Growler this looks really accessible: clivemaxfield.com/diycalculator/popup-m-round.shtml $\endgroup$ – user155385 Jul 6 '14 at 0:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.