What rounding modes are needed for decimal arithmetic?
The three most important are • round-half-even, where a number is rounded to the nearest digit, and if it is exactly half-way between two values then it is rounded to the nearest even digit. This method ensures that rounding errors cancel out (on average), and is sometimes called “Banker’s rounding”. For example, 12.345 rounded to four digits is 12.34 and 12.355 rounded to four digits is 12.36. This is also called round to nearest, ties to even. • round-half-up, where a number is rounded to the nearest digit, and if it is exactly half-way between two values then it is rounded to the digit above. Here, 12.345 rounded to four digits is 12.35 and 12.355 rounded to four digits is 12.36. This is also called round to nearest, ties away from zero. • round-down, where a number is truncated (rounded towards zero). The first of these is commonly used for mathematical applications and for financial applications (other than tax calculations) in most states of the USA. The second is used for genera