What Does ½ Really Round Off To?

Believe it or not, it’s vexed me for years.

A number like 1.5 could really round off to either 1 or 2. I remember in grade school, we were taught that it rounds off to 2. No explanation was ever given though (which is what really bothered me even back then).

I took an intro to chemistry class in a local community college (I guess I can tell you it was exactly 25 years ago now). And the teacher gave us this rather complicated odd/even rule. I forget the exact details. But rounding it off was apparently contingent on whether the number was odd or even. Again, no explanation for it was given. Although I got the impression it was just the teacher’s pet theory.

So purely SCIENTIFICALLY speaking (note my emphasis on the word), what does ½ round off to? And please this time, give an explanation why too. Thank you. :slight_smile:

There’s no “scientific” answer to the question. There’s nothing complicated to the rule: a number ending in .5 rounds to the nearest even number. It’s just a convention, not some kind of universal truth.

The reason for it is to prevent bias. If all x.5 numbers rounded down or up, when we computed an average in the end we’d get a number a little less (or more) than the real average. Rounding to even helps reduce this effect (although it won’t help if, for example, all the input numbers are between 0.0 and 1.0).

1.5 is halfway between 1 and 2.

“What does it really round to?” is like asking whether the exact midpoint of a journey is closer to the start or to the destination.

0,1,2,3,4 five digits round down
5,6,7,8,9 five round up

Having equal numbers high/low tends to not offset the data set.

btw Some rounding is done by the odd or even value of the last digit, odd endings round one way, even round the other, so 3.3 would be rounded down to 3, while 3.2 would be rounded up to 4.

Is this really done anywhere, or are you slightly misapplying the rule referred to in the first reply (where the leading number determines which way to round X.5)? It seems to me your example would introduce unnecessary inaccuracy.

Turning 6.0 into 6 is not rounding, as it was 6 to begin with. So you’re rounding down 1, 2, 3, 4, whereas 5, 6, 7, 8, 9 would be rounded up. That’s an asymmetry that introduces bias: There are slightly more cases where you round up than down. And that’s the bias which the odd/even rule mentioned by the OP aims to fix. A common formulation of the rule (there are various) is that 0.5 gets rounded to the nearest even integer; so 3.5 would be rounded up to 4, whereas 4.5 would be rounded down to 4. This ensures that rounding up is (roughly) as frequent as rounding down. It’s not perfect, but it saves you the troubloe of keeping track of past instances of rounding, or of having a random generator at hand.

I’ve never heard of such a rounding rule, and it would be a very odd one indeed. 3.2, rounded to integers, would, of course, be 3 and nothing but three. The odd/even rule applies only to a fraction of 0.5, not to fractions different from 0.5 that are simply rounded to the nearest integer.

It is rounding, because a value rounded to 6 is not the same as 6.0 even if the initial value is 6.0. The rounded value is not the same precision as the original data set. So it’s an apple to oranges comparison.

The 6 in rounding does not represent 6 but a range around 6, which 6.0 fits into.

I think you are all missing the point, which is a consistent rule. When you round to a whole number, only the first decimal matters (the tenths). But there could be other decimals.

These all round to 1:

These all round to 2:

It’s easy to see that rounding up is the right answer for the first two, and for the third we are just being consistent.

This is correct.

It’s also correct, as @tofor pointed out, that if there are any more digits after the 5, the number is closer to 2 than to 1.

But the most general answer to “What’s the rule for rounding?” would be to answer with another question: “Why are you rounding?” The rule depends on the context.

In some contexts it’s important to avoid bias, so you would follow @Dr.Strangelove’s rule (which, note, only applies if the number genuinely ends in 5), which I think is the “complicated rule” that the OP alludes to. In other contexts, it just doesn’t matter that much, or there’s essentially zero probability of getting a number that’s exactly halfway between two integers. And there are contexts in which, for reasons related to that particular context, you should always round up, or always round down, or never round at all.

The general rule is to round to the even number.

6.5 → 6
5.5 → 6

This means that in a group of numbers, the rounded amounts will cancel out. (Probably not entirely true, but close enough).

The difference is that both 1.4000001 and 1.4 are closer to 1 than they are to 2, but while 1.5000001 is closer to 2 than to 1, 1.5 isn’t. Using lots of decimal places doesn’t make the fact that x.500000000000000 is still exactly between x and x+1 go away.

Whatever your level of precision, rounding exactly x.5 up to x+1 will introduce bias, while some kind of split rounding rule where x.5 is rounded up half the time and down half the time will not.

It’s possible that you don’t care about that bias, or that it’s small enough, given your data set, that the simpler rule (always round up x.5) is a better one. But don’t fool yourself into thinking it’s equal.

If you actually have 9 decimal digits in your measurement and you’re rounding to 0 (seems unlikely), then the amount of bias introduced will be very small on average, but not zero.

This “even number rule” was somehow never taught to me in grammar school, high school, or college (took a couple calc classes and a stats class – I guess we wouldn’t really round in the first.) The only rule I learned was 5 always rounds up, which I found weird for the reasons given: it quite obviously introduces bias. It wasn’t until some time after college I heard the “round to the nearest even” rule.

One good way to see that the apparent symmetry between “round 0,1,2,3,4 down and 5,6,7,8,9 up” is false is to consider other number representations. Like, consider the analogous rule for binary numbers: round 0 down and 1 up.

But that would mean that to round, dropping a decimal, would add something to half the numbers and do nothing to the other half. That really obviously introduces significant bias.

The nearest-even rule only ever appeared to me in a single college chem course. All of my other physics, math, engineering never used the rule and did a simple round up regardless of odd or even.

A previous thread on rounding:

For what it’s worth, the “round 5 to even” rule is called “banker’s rounding”, because banking is one context where you very definitely don’t want to introduce bias.

Incidentally, more complicated rounding rules are possible. For instance, where’s the line of scrimmage in football? It’s always the integer yard line closest (in the judgement of the officials) to where the ball was downed (if it’s unclear which line is closer, then the officials just make a judgement call and choose one)… unless the closest integer yard line is one of the goal lines, in which case it’s rounded to 1 yard.

OK, now here’s a more subtle question: What do you do with negative numbers? Does -1.5 go to -1, because that’s rounding up, or does it go to -2, making the absolute value go up?

People who create computer arithmetic systems have to pay attention to details like this, but most folks (even scientists and engineers), to the extent that they worry about it at all, just let their computer system of choice follow its default behavior. After all, if it matters whether a terminal 5 rounds up or down, then that’s an argument that you shouldn’t have been rounding in the first place.

Me too - at school in the UK in the late 1970s/early 80s, they never introduced us to banker’s rounding - it was just taught as: Digits 0,1,2,3,4 round down; digits 5,6,7,8,9 round up.

This [round to nearest, ties to even] is the default rounding mode if you use IEEE 754 floating-point arithmetic.

This [ties round up] is an alternative rounding mode. So is having ties round away from zero, or towards zero, or randomly, etc.

I know I’ve encountered the “banker’s rounding” rule somewhere, but I can’t remember where or when. Probably not before I got to college.

I think I first encountered it when I was working with the currency data type in Microsoft Access DBs - it rounds to even, and I wasn’t expecting it to