What is Round half to even?
Rounding to the nearest representable value and, on an exact tie, to the one whose last bit is even (0). It is the IEEE 754 default and keeps rounding errors from accumulating in one direction.
Japanese name: 最近接偶数丸め
Rounding to the nearest representable value and, on an exact tie, to the one whose last bit is even (0). It is the IEEE 754 default and keeps rounding errors from accumulating in one direction.
Japanese name: 最近接偶数丸め
An exact result usually has more significand bits than the destination format can hold. Besides the bits it keeps, the hardware tracks the first discarded bit, called the round (or guard) bit, and a sticky bit that is the OR of all bits below it. If the round bit is 0 the result is truncated; if the round bit is 1 and the sticky bit is 1, the result is rounded up in magnitude. Only when the round bit is 1 and the sticky bit is 0 is the value exactly halfway, and then the last kept bit decides: if it is 1, round up to make it 0.
Rounding every tie upward adds a small positive error each time, and over many operations those errors pile up in one direction. Sending ties to the even neighbor rounds them up about half the time and down the other half, so the errors tend to cancel. In decimal terms, 2.5 becomes 2 and 3.5 becomes 4, preserving their sum of 6, whereas always rounding up would give 7. The method is also called banker's rounding, and in binary floating point the even choice is the one whose least significant significand bit is 0.
IEEE 754 also defines directed rounding: toward zero (truncation), toward positive infinity and toward negative infinity. These are selected explicitly for special purposes; for example, interval arithmetic computes a lower bound rounded down and an upper bound rounded up so the true result is guaranteed to lie between them. A revision of the standard added round half away from zero for ties, required mainly for decimal formats. Round half to even remains the default for both arithmetic and conversions, and correctly rounded operations are defined as the exact result rounded in the current mode.
Python's built-in round follows ties-to-even, so round(2.5) returns 2, which looks like a bug to anyone expecting school rounding. A second surprise comes from representation: a decimal value such as 2.675 cannot be stored exactly in binary, and the nearest double is slightly below it, so rounding to two decimal places gives 2.67 regardless of the tie rule. When results must follow a specific decimal rounding convention, such as in financial calculations, decimal arithmetic types with an explicit rounding mode are the usual solution.
Answer: B. 2 and 4
Both are exact ties, so each rounds to the even neighbor: 2.5, halfway between 2 and 3, goes to 2; 3.5, halfway between 3 and 4, goes to 4. Always rounding ties up would give 3 and 4, summing to 7, one more than the original sum of 6, whereas rounding to even gives 2 + 4 = 6, preserving the sum. 2 and 3 result from always rounding ties down. Avoiding biased rounding error is the method's strength.
Python 3 rounds exact ties to the nearest even value, the same rule IEEE 754 uses by default, so 2.5 goes to 2 and 3.5 goes to 4. This avoids a systematic upward bias when many values are rounded.
Yes. Both names describe rounding to the nearest value and, on an exact tie, choosing the neighbor with an even last digit or bit.
Round to nearest, ties to even. Directed modes toward zero, positive infinity and negative infinity are available but must be selected explicitly.
Round half to even appears in 2 practice questions across 1 topic, including Computer Arithmetic.
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.