What rounding does, and what it costs
Rounding replaces a number with the nearest value that can be written at a chosen place. It is a deliberate loss of information, and the only interesting questions about it are how much you lost and what happens when two candidates are equally near.
Every rounding operation has the same shape. Shift the number so that the place you care about becomes the ones place, turn the shifted value into an integer, then shift back. Rounding 3.14159 to hundredths means multiplying by 100 to get 314.159, deciding between 314 and 315, and dividing back. Rounding 1,234.5678 to the nearest hundred means dividing by 100 to get 12.345678, deciding between 12 and 13, and multiplying back. One mechanism, one formula, whichever direction the place lies.
The cost is bounded and predictable. Under any nearest-value rule the error is at most half a unit of the rounding place: rounding to hundredths can move a value by no more than 0.005, rounding to the nearest thousand by no more than 500. Under truncation the bound is a full unit, and truncation is always biased toward zero rather than error-free on average, which is why it belongs in computing rather than in reporting.
What makes rounding worth a calculator is the tie. When the discarded part is exactly half a unit, the two candidates are equally close and the arithmetic gives you no reason to prefer either. Every rule you have ever heard of is a different answer to that question, and they disagree by a full unit of the rounding place.
The six rules and where each one belongs
Half away from zero. Ties go to the candidate further from zero: 2.5 becomes 3, −2.5 becomes −3. This is the rule taught in schools and the one most people mean by “rounding”. It is symmetric about zero, which is its main virtue, but it is biased upward in magnitude: across a long run of ties, every one of them inflates the total.
Half to even, or banker's rounding. Ties go to whichever candidate is even: 2.5 becomes 2, 3.5 becomes 4, −2.5 becomes −2. Because even and odd neighbours occur about equally often in real data, the upward and downward pushes cancel over many operations instead of accumulating. This is the default rounding mode specified by IEEE 754 for binary floating-point arithmetic, so it is what your processor does unless told otherwise, and it is the rule most accounting and statistical conventions adopt for the same bias argument.
Half up, toward positive infinity. Ties always move up the number line: 2.5 becomes 3 and −2.5 becomes −2. Note the asymmetry — this is not the school rule, and the two differ on every negative tie. Spreadsheet and database rounding functions differ on which of these two they implement, which is a genuine source of reconciliation errors between systems.
Ceiling and floor. These ignore ties because they ignore the discarded digits: ceiling always moves up, floor always moves down, at any value. Ceiling is what you want for sizing — how many buses, how many sheets of plywood — where a fractional answer means you need the next whole one. Floor is what you want for capacity limits you must not exceed.
Truncation. Cut the digits off and keep what is left, which moves the value toward zero: 3.999 truncated to one decimal is 3.9, and −3.999 is −3.9. This is what integer division does in most programming languages and what a display does when it simply stops printing. It is never appropriate for reporting a measurement, because its error is up to twice that of nearest-value rounding and always in the same direction relative to zero.
Worked example: 3.14159 to two decimal places, then a tie
The straightforward case. Round 3.14159 to hundredths.
- Identify the place. Two decimal places means one unit of the rounding place is 10⁻² = 0.01.
- Shift. 3.14159 × 100 = 314.159.
- Look at the leftover. The fractional part is 0.159, which is less than 0.5, so the nearer integer is 314. Equivalently, the digit immediately right of the hundredths place is 1.
- Shift back. 314 ÷ 100 = 3.14.
- Cost. 3.14 − 3.14159 = −0.00159, which is 0.00159 ÷ 3.14159 = 0.000506, or 0.0506% of the original. Well inside the half-unit bound of 0.005.
Every rule except ceiling gives 3.14 here, because there is no tie to break: ceiling gives 3.15 because it always moves up.
The tie. Now round 2.5 to a whole number. The fractional part is exactly 0.5, so 2 and 3 are equally close and the rules split:
- Half away from zero → 3.
- Half to even → 2, because 2 is the even neighbour.
- Half up → 3.
- Ceiling → 3; floor → 2; truncate → 2.
Change the sign and the split changes with it. For −2.5: half away from zero gives −3, half up gives −2, half to even gives −2, ceiling gives −2, floor gives −3, truncate gives −2. The school rule and the half-up rule agree on every positive tie and disagree on every negative one, which is exactly the kind of discrepancy that shows up as a one-penny difference between two systems reconciling the same ledger.
A place value to the left. Round 1,234.5678 to the nearest hundred. Divide by 100 to get 12.345678; the fractional part 0.345678 is below 0.5, so take 12; multiply back to get 1,200. The digit examined is the tens digit, 3. The change is −34.5678, comfortably within the half-unit bound of 50.
Choosing a rule and reading the error
Match the rule to the consequence of being wrong. If a fractional answer means you need one more of something, use ceiling — 4.1 buses is 5 buses, and no tie-breaking rule will save a stranded passenger. If exceeding a limit is unacceptable, use floor. If you are reporting a measurement, use a nearest-value rule, and prefer half to even when the numbers will be summed, because that is the case where a systematic tie bias compounds.
Round once, at the end. Rounding intermediate results and then rounding again accumulates error that a single rounding would not produce. A value rounded to hundredths and then to tenths can land a full step away from where the original would have gone: 2.45 rounds to 2.5 and then to 3 under the school rule, while 2.45 taken straight to a whole number gives 2. This is called double rounding, and it is why standards for financial and scientific reporting specify rounding from the unrounded original.
Read the rounding error as a percentage when scale varies. Losing 0.005 from a value of 3.14 is 0.16%; losing the same 0.005 from a value of 0.01 is 50%. The absolute bound is fixed by the place, so the relative damage grows as the value shrinks. This is the argument for rounding to significant figures rather than to decimal places whenever your data spans orders of magnitude — significant figures fix the relative precision instead of the absolute one.
Expect binary surprises at exact halves. Decimal fractions such as 0.1, 2.675 and 1.005 have no exact binary representation, so what a computer stores is a hair above or below what you typed. Ask a naive routine to round 1.005 to hundredths and it may return 1.00, because the stored value is fractionally below the tie. This calculator treats a value within a rounding error of a tie as a tie, so it answers the question you asked rather than the one the hardware stored, and it tells you when it has done so.
How the six rules treat the same values
| Value | Half away from zero | Half to even | Half up | Ceiling | Floor | Truncate |
|---|---|---|---|---|---|---|
| 0.5 | 1 | 0 | 1 | 1 | 0 | 0 |
| 1.5 | 2 | 2 | 2 | 2 | 1 | 1 |
| 2.5 | 3 | 2 | 3 | 3 | 2 | 2 |
| 2.4 | 2 | 2 | 2 | 3 | 2 | 2 |
| −0.5 | −1 | 0 | 0 | 0 | −1 | 0 |
| −1.5 | −2 | −2 | −1 | −1 | −2 | −1 |
| −2.5 | −3 | −2 | −2 | −2 | −3 | −2 |
| −2.4 | −2 | −2 | −2 | −2 | −3 | −2 |
Half away from zero and half up agree on every positive tie and disagree on every negative one. Half to even sends 0.5 and 2.5 down but 1.5 and 3.5 up, which is how it avoids a net bias.
Rounding mistakes that change an answer
- Double rounding. Rounding to an intermediate place and then rounding again can land a whole step away from rounding the original once. Always round from the unrounded value.
- Assuming half up and half away from zero are the same rule. They agree on positive numbers and disagree on every negative tie, which is a classic cause of one-cent reconciliation differences between two systems.
- Rounding before an operation instead of after. Rounding each item on an invoice and then summing gives a different total from summing and rounding once. Tax authorities specify which order applies; the difference is real money.
- Using truncation as if it were rounding. Truncation has twice the worst-case error and is systematically biased toward zero, so a column of truncated values is a column with a known downward bias in magnitude.
- Rounding to a fixed number of decimal places across data that spans orders of magnitude. Two decimals is generous for 0.004 and meaningless for 4,000,000. Use significant figures when the scale varies.
- Reporting more places than the measurement supports. Rounding cannot add precision. A reading good to three digits is not made better by writing six.
- Rounding percentages that must sum to 100. Rounding each share independently often produces 99.9% or 100.1%. Round the shares and then correct the largest one, or state that the figures do not sum because of rounding.
Rounding, significant figures and the standards that govern them
Rounding to a decimal place fixes the absolute precision of the result; rounding to significant figures fixes the relative precision. Which one you want depends on whether the meaningful error in your data is a fixed size or a fixed proportion. Currency is absolute — a cent is a cent whether the invoice is for £5 or £5,000 — so money is rounded to decimal places. Physical measurements are usually relative, because instrument error scales with reading, so measurements are reported to significant figures. The significant figures calculator handles that second case, including the awkward question of how many digits survive a multiplication.
Several documents set the rules explicitly. IEEE 754 defines five rounding-direction attributes for floating-point arithmetic, with roundTiesToEven as the default for binary formats — this is why the same calculation can differ in the last bit between a language that uses the hardware default and one that implements a decimal rule in software. ISO 80000-1 gives rounding conventions for quantities and units, and NIST Special Publication 811 gives the corresponding guidance for reporting SI measurements, including the advice to carry extra digits through a calculation and round only the final result.
Two neighbouring operations often get confused with rounding. Truncating a display is not rounding: a readout that shows 3.14 for a stored 3.14159 has rounded, while one that shows 3.14 for a stored 3.149 has truncated, and you usually cannot tell which from the display alone. Converting to a fraction is a different approximation entirely — the decimal to fraction calculator finds the nearest fraction with a bounded denominator, which can be closer than any decimal rounding of the same length, and the fraction to decimal calculator goes the other way and shows you where the repeating block starts.
Finally, if you need the rounding error quantified against a reference rather than against the original, that is the same arithmetic as percent error: the difference divided by the accepted value. Rounding is simply the case where you introduced the error deliberately and know its bound in advance.
