Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

If you want to round the repeating decimal 0.4999... to a whole number what is the right answer? Is it 0 or 1?

On the one hand you only look at the first digit when you round numbers which in this case is 4 so the answer should be 0.

On the other hand 0.4999... is only another representation for 0.5 which makes the result 1.

My question
Which of these rules wins? (My gut feeling is that the most consistent result should be 1)

Just for clarification: What is meant by rounding here is replacing a fractional decimal number by one with fewer digits with the "Round half up"-Tie-breaking method.

share|improve this question
It appears that the rule is inconsistent. –  Isaac Solomon Oct 21 '12 at 9:04
Doesn't that depend on what type of rounding you are using? If you're using Bankers Rounding, you would round towards 0. –  Fake Name Oct 21 '12 at 12:22
@FakeName: Fair enough. What is obviously meant here is replacing a fractional decimal number by one with fewer digits with the "Round half up"-Tie-breaking method: en.wikipedia.org/wiki/Rounding –  vonjd Oct 21 '12 at 13:50
This question should NOT be closed; it has a definitive answer - with references "out there" to support it. At the point when this was closed, the issue on the table (discussion!) was if 0.499... was 0.5 or not: reference is en.wikipedia.org/wiki/0.999... –  Richard Sitze Oct 22 '12 at 0:08
I agree with Richard. Given that we have a method for rounding midpoint values, and the author of the question has supplied a method, it follows that this question has an answer. –  Doug Spoonwood Oct 22 '12 at 2:52
show 6 more comments

12 Answers

up vote 116 down vote accepted

It's $1$, because $0.49\ldots$ is the same as $0.5$. If rounding is to be well-defined, it can't map one real number to two integers, so whatever it maps $0.49\ldots$ to, it better maps it to the same integer as $0.5$. You could round both to $0$, of course, but that wouldn't then be the way we usually round.

What this shows you is that rounding doesn't commute with limits, i.e. there's a difference between find the limit of a sequence and then rounding, and rounding first and then finding the limit. As you correctly observed, all values $a_n = 0.4\underbrace{9\ldots 9}_{n\text{ times}}$ are rounded down to zero. Thus, $$ \lim_{n\to\infty} \text{round }(a_n) = 0 $$ On the other hand, $\lim_{n\to\infty} a_n = 0.5$, and thus $$ \text{round }\left(\lim_{n\to\infty} a_n\right) = 1 $$

There's another word for functions which don't commute with limit - they're called non-continuous. So what you have discovered is simply that rounding is not a continuous function.

share|improve this answer
Perhaps I'm nitpicking, but is the result of rounding the limit perhaps $1$ instead? –  pimvdb Oct 21 '12 at 10:05
@pimvdb: I went ahead and edited the answer, since it's obviously what was intended. (And so many people seem to agree.) –  ShreevatsaR Oct 21 '12 at 14:30
+1 especially for pointing out the connection with continuity. –  Neal Oct 21 '12 at 16:00
@pimvdb Indeed the limit should be $1$, and I wouldn't call pointing out blatant errors nitpicking ;-) Thanks for noticing, and thanks to ShreevatsaR for fixing this! –  fgp Oct 21 '12 at 19:42
@jmoreno - but it is, in fact the same as 0.5: en.wikipedia.org/wiki/0.999... –  Richard Sitze Oct 22 '12 at 0:01
show 3 more comments

This is just an obersvation that I was missing in the many answers already given.

While there is absolutely no doubt that the mathematical function $\Bbb R\to\Bbb Z$ defined by $x\mapsto\lfloor x+\frac12\rfloor$ when applied to the real (in fact rational) number represented by the repetitive infinite decimal sequence $0.4\overline9$ takes as value the integer$~1$, saying that this is what happens when rounding the repeating decimal $0.4999\ldots$ is misleading. That is because "rounding" suggests an operation done during actual computation. This ignores the often overlooked fact that it is impossible to do arithmetic computations with infinite decimals. This does not mean of course that there isn't a class of infinite decimals with which computations are possible; for instance if all decimals are repeating, then one can replace them by rational numbers and compute with those, which is definitely possible. However the misconception is that, because we can do arithmetic on numbers with any fixed number of decimal places and the procedures for doing so are always basically the same, therefore one can apply these same procedures to infinite decimals. However just looking at these procedures will reveal that this is plainly false: all of these procedures need at some point (often right at the beginning) to locate the final decimal position, and for an infinite decimal such a position simply does not exist. This means that in practice whenever one needs rounding decimal numbers as a computational operation, then those decimals are necessarily finite, and the number $0.4999\ldots$ simply cannot occur.

In fact there is no effective system for computing with (general) true real numbers at all, for the simple reason that the majority of the real numbers cannot be represented in any way (a concrete representation having to be, by the nature of things in the real world, finite). One can however restrict to the (countable) subset of real numbers that do allow some kind of representation (which is less brutal that restricting to some arbitrarily chosen finite subset of numbers declared representable, as is done in numeric computation), and then arithmetic and other kinds of computation do become possible, and indeed can be done without having to introduce approximations. This has been studied in constructive mathematics, but it turns out that for this purpose representing real numbers by infinite decimals, which might be produced on demand by a finite algorithm, is not a viable option. Even just finding the first decimal of the sum of two numbers so given by infinite decimals cannot be assured by an algorithm; this is in fact closely related to issues invoked in this question and the related $0.9999\ldots$ problematic. This in contrast to computations with formal power series with integer (or rational) coefficients: these suffer from the same "most elements cannot be represented" problem as the real numbers, but if one sticks to series whose coefficients can be computed by an algorithm, then all arithmetic (and many other) operations on them can be performed algorithmically without problem.

A more workable way to represent real numbers is by a sequence of definite approximations (rational numbers with a given maximal error), with some kind of guarantee that the error tends to $0$. But even then there are sacrifices one has to make: it is impossible to computations with discontinuous functions (like the floor or round-to-integer operations): in the constructive theory of real numbers there only exist continuous functions. So all of this is rather far removed from what one does in numeric computation, where real numbers are necessarily approximated, the number of decimals finite, and the question of how to round $0.4\overline9$ moot; the rule for rounding of looking at the first digit to be discarded in the rounding is perfectly valid in practice.

share|improve this answer
add comment

$1 - 0.5 =0.5 \quad$ and $\quad 1 - 0.4999\ldots = 0.500\ldots = 0.5 \quad$ so $\quad 0.5 = 0.4\overline9 $

Well, the above line says the proof / intuition. From our information... $0.5$ well rounds to $1$.

share|improve this answer
Are you sure that $1-0.4999\ldots\ne 0.500\ldots1$? –  MJD Nov 18 '12 at 16:46
@MJD: Not sure if serious... –  Clive Newstead Nov 18 '12 at 16:47
@MJD: In 0.500...1, the zeroes never end, so the $1$ never comes ;) –  Parth Kohli Nov 18 '12 at 16:52
add comment

@fgp answered this well but there is another aspect that I don't think has been touched on in any of the answers. What is the type of thing that we should consider as an input to the process of rounding? If it is a real number, we are unable to apply the rule without a specific digit sequence representing that number. If instead we interpret rounding as an operation on a possibly infinite digit sequence, we can now apply the rule, but its result has no meaning for general real numbers. One way out which has been discussed is to make a bijection between digit sequences and reals by disallowing digit sequences ending in $999...$, and this view effectively unasks the question by taking the position that $0.4999...$ is not a valid representation of a real number, but I think this is an overly burdensome technicality.

I think an easier way to look at it is just to say that rounding is an operation that applies to finite digit sequences and not to real numbers in general nor to infinite digit sequences. When we say something like "$\pi$ rounds down to $3$" it is a lazy way of saying that all sufficiently precise approximations do. But when we say "$0.5$ rounds up to $1$", exactly that is meant, because we don't mean to suggest that $0.4 + \sum_{k=2}^{n}{9 \cdot 10^{-k}}$ will round up to $1$ for sufficiently large $n$. And without context, if it is said about a real number $x$ that "$x$ rounds up to $1$" then that can be read as "$x$ has a finite decimal representation which rounds up to $1$, or $x$ has no finite decimal representation and all sufficiently precise finite decimal approximations to $x$ round up to $1$". In this way we can meaningfully discuss rounding real numbers in terms of rounding finite digit sequences, and without explicitly addressing the problem of sequences ending in $999...$.

share|improve this answer
add comment

I find very convenient to define rounding as follows: $$ round(x) = \left \lfloor x + \frac{1}{2}\right \rfloor$$

Considering this rule, what follows is understanding the context. If you are working with a computer, you have only a fixed number of decimal positions to work with, in which case, if x=0.4999999999999999 (16 decimal positions), then

round(x)=floor(0.4999999999999999 + 0.5)=

Of course, if you are talking about a real number, then 0.4999... equals 0.5, in which case $round(x)=1$.

So, the real question here is: are you working with a fixed number of decimal positions or not? If the answer is 'yes', then definitely round(x)=0. If the answer is 'no', then you are talking about a number which is equal to 0.5, and $round(x)=1$

share|improve this answer
add comment

It is not obvious that 0.5 should be rounded to 1. Obviously 0.49999... should be treated the same because it is the same number. Wikipedia rounding article

share|improve this answer
add comment

It is the same as 0.5 by definition of decimal numbering.

share|improve this answer
And rounding takes by definition the first digit which is 4 in this case. So this is exactly where the two definitions collide! –  vonjd Oct 21 '12 at 18:36
@vonjd I disagree that rounding by definition takes the first digit and then rounds. I ask you to try and round 1/3 without converting it into a decimal. Do you not round 1/3 down to 0, since it comes as clear that 1/3 lies closer to 0 than to 1? Or I suggest you round 12/11 to the nearest whole number. Or round 155/66 to the nearest whole number. Finding the multiples of a denominator d will help here, and what half of d equals. If the denominator equals 7, then if the numerator of "the remainder" equals 1, 2, or 3 we round down, if the numerator equals 4, 5, or 6 we round up. –  Doug Spoonwood Oct 21 '12 at 19:17
E. G. Say we have 13/7. 13/7=7/7+6/7, correct? So, 13/7 has "remainder" of 6/7, or in other words it has a fractional part (search that term on Wikipedia) of 6/7. Thus, 13/7 rounds up to 14/7 (6/7 lies closer to 7/7 than to 0/7). You could also try and rounding numbers in binary, trinary, or any n-ary base system. E. G. round 1.34523 in base 7. In base 7, 1.4142 rounds up to 2. So, I simply do not see how the digit makes the difference here. More goes on than that! –  Doug Spoonwood Oct 21 '12 at 19:23
@vonjd this is an exception. rounding takes first digit EXCEPT for values like this, where fraction is written in limitless form. –  Suzan Cioc Oct 21 '12 at 19:25
add comment

As a programmer, 0.4999... is closer to 0 than it is to 1, so I would always round down to 0.

Keep it simple! Rounding is always to the closest whole number. You only need to apply special cases when there are two closest whole numbers.

But there are situations where this would be the wrong choice, so you need to do some research every time you apply rounding function to a value.

For example, the tax department in the country I live in does not always acknowledge cents. Under legislation, there are times when the only valid rounding function is floor.

share|improve this answer
I think we all agree that $0.4999$ should round down to $0$. The question is whether $.499999999......$ should (with infinitely many $9$s). –  Jason DeVito Oct 21 '12 at 18:16
How close $0.4999...$ is to $0$ or $1$ is independent on whether or not you are a programmer. In fact, it is the same distance from $0$ and $1$. If the sequence of digits were to terminate after finitely many (e.g. in computing) then fine, but here we have infinite precision and the number is exactly equal to $0.5$. –  Clive Newstead Oct 21 '12 at 18:20
@AbhiBeckert: The case in point is that it is indeed equal to 0.5, as is 0.999... equal to 1: en.wikipedia.org/wiki/0.999... –  vonjd Oct 21 '12 at 18:32
Dear Abhi, I have downvoted your answer, since it it seems to be premised on a confusion with regard to the fact that $0.4999\cdots$ (infinitely many $9$'s) is equal to $0.5$. Regards, –  Matt E Oct 21 '12 at 19:56
@AbhiBeckert: If you accept that $0.4999...$ is a real number, and you also claim it's less than $0.5$, then (1) you should be able to say what is the distance between them (for any two real numbers $x<y$, their distance is another real number $y-x$: and no, "infinitesimal" is not a number), and (2) you should be able to exhibit a number that lies between them (for any $x<y$, there exist infinitely many real numbers between, e.g. $x<(x+y)/2<y$). The fact that there is no number between $0.4999...$ and $0.5$ should convince you that they are two representations of exactly the same number. –  ShreevatsaR Oct 23 '12 at 5:16
show 10 more comments

If you consistently use the round-up half method you don't always look at the first digit of the numeral when rounding numbers. You go by the method. The method allows that if we have anything else than a half-way value, then you can round by the rule "if (working in base 10) the first digit of the numeral after the decimal point belongs to {0, 1, 2, 3, 4}, then round down, if the first digit of the decimal point belongs to {5, 6, 7, 8, 9}, then round up." But, that rule does not say anything about half-way values. Going by q=FLOOR(y + .5) we can reason as follows: q=FLOOR(.499... + 5)=FLOOR(.999...)=FLOOR(1)=1, since .999...=1. So, that method yields that .499... rounds to 1.

share|improve this answer
add comment

If we round c to d, then c approximately equals d. If d also consists of an integer, then c lies closer to d than any other integer i. In other words for all integers i such that i does not equal d, ABS(ci-)>ABS(cd-), where ABS(ci-) indicates the number by which c and i differ by (the absolute value of the difference of c an i). This implies that we can use the distance metric between real numbers to see how rounding works as follows.

Consider the set S=={[l, lu+2/), (lu+2/, u]} where ul-=1. In other words, l and u differ by 1, and we consider the set of all numbers between x and y except for the midpoint m==lu+2/ between them. We can use the metric function D(x,y)=|xy-|=ABS(xy-), where x belongs to S and y belongs to {l, u}, to determine how to round all members of S by following rule:

If D(x, l)>D(x, u), then round to u. If D(x, u)>D(x, l), then round to l.

Since .5=.49999..., it follows that D(.49999..., 1)=D(.49999...., 0)=.4999...=.5. Thus, the distance function D(x, y)=ABS(xy-) does not give us any guide as to how to round here.

Consequently, we have several different choices that we can make which will not go against our intuition of rounding as follows:

  1. Choose to round .49999... to 1 (maybe you value larger numbers in general),
  2. Choose to round .49999... to 0 (maybe you value smaller numbers in general),
  3. Choose to allow .49999... to get rounded to both as one pleases or sees fit at particular points in time, or
  4. Choose to round .49999... to neither 0 nor 1 (maybe you don't want to make a choice here).

None of those possibilities win or lose until we have a standard to measure a winner or loser for the rules. There also doesn't exist a "right answer" here unless we have a means to determine what properties a "right answer" has in this context. I suspect that many people would resist 3. with the possibility that one could round .4999... to 1 at one time, and then round .4999... to 0 at another as one pleases, thus indicating arbitrariness. But, it does not follow that such comes as an improper procedure unless one first rates such "arbitrariness" as bad, and something so utterly awful and terrible that we or others must never, ever engage in such "arbitrariness". Perhaps many people would see 4. as "evasive", but unless there exists a logical basis to picking either 0 or 1, anyone accused of "evasiveness" by picking 4. could very well respond to such a charge, that anyone who sees choosing 4. as indicating "evasiveness", insists dogmatically that all such questions absolutely must have answers, and/or that the people claiming "evasiveness" have copped out of making choices on the basis of logic as much as possible.

So, what sort of choice do you want to make?

share|improve this answer
add comment

For $0\le x\le 1$, we round $x$ to $1$ if $x\ge \frac12$ and to $0$ if $x<\frac12$ (though there are many conventions, see e.g. Wikipedia on rounding; the section "Table-maker's dilemma" a bit further down may also be interesting). Since $0.4\bar9=\frac12$, we should round to $1$. Another way of looking at this is that we always consider only the standard decimal expansion (i.e. we prefer $\bar0$ over $\bar 9$), and we are allowed to treat the first decimal as $4$ only if we know that it cannot turn out as $5$ "later". Thus if an inexact measurement gives us that $0.495\le x\le0.5$, we cannot say definitely, what $\operatorname{round}(x)$ should be (we could if the measurement resulted in $0.495<x<0.5$). This is not different from the fact that we cannot say definitely what $\operatorname{round}(x)$ should be if our measuremen merely says that $0.4997<x<0.5003$.

share|improve this answer
add comment

You're right. Since $.4\bar{9}=.5,$ if you want your rounding function to be well-defined you'll have to require an exception: round based on the first digit after the one you're rounding to, unless it's a $4$ followed by infinitely many $9$s.

share|improve this answer
add comment

protected by Qiaochu Yuan Oct 21 '12 at 23:47

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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