4 ms·
> Round to nearest even is the default IEEE rounding mode. This means that 5.5 rounds to 6, and 6.5 also rounds to 6. Wat. I had never even heard about this, b
by maho 13y ago
> Round to nearest even is the default IEEE rounding mode. This means that 5.5 rounds to 6, and 6.5 also rounds to 6.
Wat. I had never even heard about this, but the more I read and think about it, the more this rule makes sense to me.
How did I miss this - is this commonly taught in school and I just did not pay attention? It seriously worries me that I don't even know how to round properly - I always thought of myself as a math-and-sciency guy...
- ghayes 13y agoI learned about this in HS chem class and it's always stuck, even if people don't use it in informal settings. Also called "unbiased rounding" or "bankers' rounding" [1] [1] http://en.wikipedia.org/wiki/Rounding#Round_half_to_even http://en.wikipedia.org/wiki/Rounding#Round_half_to_even
- hvidgaard 13y agoit's rarely taught in school. Most people know that you round .5 up, but that is a slightly uneven distribution and rounding to the even number however produce a perfectly even distribution. It's also the way you round in the financial sector.
- pkolaczk 13y agoFinancial sector of many (all?) countries in UE is required to round all .5 up. If you use banker's rounding, you might get into trouble with the tax office. So always check the local regulations for the rounding mode.
- hvidgaard 13y agoI'm not sure what UE is. But as usual, always get the actual specifications for whatever you're doing.
- skrebbel 13y agoUnia Europejska.
- quarterto 13y agoUnión Europea.
- aspensmonster 13y agoEuropean Union.
- frandroid 13y agoUnion Européenne
- dj-wonk 13y agoEU
- aspensmonster 13y agoI'm not sure what EU is.
- deleted 13y ago[deleted]
- maho 13y agoI don't believe the round-to-next-even-method will give you a perfectly even distribution. Benford's law can be generalized to the second, third, ... digit, and although the distribution is not as skewed as for the first digit [1], you'd still be rounding down a bit more often than rounding up. Benford's law applied to rounding floats is splitting hairs, really - but it goes to show how even "simple" things like rounding can be really difficult if you only worry about them for too long. [1] http://en.wikipedia.org/wiki/Benford%27s_law#Generalization_to_digits_beyond_the_first http://en.wikipedia.org/wiki/Benford%27s_law#Generalization_...
- hvidgaard 13y agoTrue, what I meant was that it's unbiased, and will represent the distribution of the source.
- sampo 13y agoBut it won't. You'll still be rounding down a tiny bit more often than rounding up.
- robzyb 13y agoYou're over-intellectualizing the issue. Benfords law only applies to certain sets of numbers. Not all numbers display Benfords law. Therefore Benfords law should not be considered when talking about rounding unless there's a reason to think that it applies to your particular set of numbers.
- cbr 13y agoThe interesting thing about Benford's law is how widely applicable it is. Most sets of numbers you come across in your life are likely to follow it, or at least have leading 1s be more common than leading 9s. As such we should definitely be considering it when trying to decide which rounding rule to adopt in the general case.
- mzs 13y ago
- deleted 13y ago[deleted]
- Ciechanowski 13y agoPercentages is the best example of why it's so useful. For value A at 41.5% and value B at 58.5% their sum is equal to 100%. Rounding up would make them 42% and 59% respectively, thus 101% in total. Round half to even ensures the final values of 42% and 58% sum to 100% as intended.
- Pxtl 13y agoI learned the "round .5s to the nearest even" in my first year of undergrad engineering. Don't remember seeing it in high-school.