···28282929* If you really need your results to add up exactly, especially when you work with money: use a special [decimal datatype](/formats/exact/).
3030* If you just don't want to see all those extra decimal places: simply format your result rounded to a fixed number of decimal places when displaying it.
3131-* If you have no decimal datatype available, an alternative is to work with [integers](/formats/integers/), e.g. do money calculations entirely in cents. But this is more work and has some drawbacks.
3131+* If you have no decimal datatype available, an alternative is to work with [integers](/formats/integer/), e.g. do money calculations entirely in cents. But this is more work and has some drawbacks.
32323333### Why do other calculations like 0.1 + 0.4 work correctly?
3434
+1-1
content/errors/rounding.html
···5151| -1.6 | -1 | -2 | -2 |
5252| 2.6 | 2 | 3 | 3 |
5353| 2.5 | 2 | 3 | 2 |
5454-| -2.4 | -2 | -2 | 2 |
5454+| -2.4 | -2 | -2 | -2 |
55555656Note that for [base 2](/formats/binary/), both "rounding half" modes are identical.
5757More [rounding methods](http://en.wikipedia.org/wiki/Rounding) can be found at Wikipedia.