This approximation mode is used by most processors, and is called,
in short ''rounding''. The idea is to
choose the FP number ( or )
which offers the best approximation of :
The roundoff for the ``round to nearest'' approximation
mode satisfies
There is a fine point to be made regarding ``round to nearest'' approximation. What happens if there is a tie, i.e. if is precisely ? For example, with 6 digits mantissa, the binary number can be rounded to or to . In this case, the IEEE standard requires to choose the approximation with an even last bit; that is, here choose . This ensures that, when we have ties, half the roundings will be done up and half down.
The idea of rounding to even can be applied to decimal numbers also (and, in general, to any basis). To see why rounding to even works better, consider the following example. Let and compute with correct rounding. All operations produce exact intermediate results with the fourth digit equal to 5; when rounding this exact result, we can go to the nearest even number, or we can round up, as is customary in mathematics. Rounding to nearest even produces the correct result (), while rounding up produces .
An alternative to rounding is interval arithmetic. The output of an operation is an interval that contains the correct result. For example , where the limits of the interval are obtain by rounding down and up respectively. The final result with interval arithmetic is an interval that contains the true solution; if the interval is too large to be meaningful we should repeat the calculations with a higher precision.
In conclusion, real numbers are approximated and represented in the floating point format. The IEEE standard recognizes four approximation modes: