Rounding Methods Explained
Half up, half away from zero, half even, ceiling, floor and truncation compared on the same numbers, including negatives, with the formula behind each.
Rounding Methods Compared
No single rounding method is correct for every situation. The choice changes the result for numbers exactly halfway between two candidates, and the effect differs for negative numbers. Primary-school lessons teach round half up, but IEEE 754-2019 defaults to roundTiesToEven for floating-point arithmetic, and Python's round() uses half even. JavaScript's Math.round() rounds half away from zero. Know which rounding methods your tools actually use.
The general rounding formula is round(N / S) × S. N is the original number. S is the scale, for example 0.01 for hundredths or 1 for whole numbers. The formula works regardless of your rounding method, but the result changes because the round() function inside it behaves differently depending on which method you apply. Understanding the general rounding formula gets you only as far as the math. Choosing the right tie-breaking rule gets you a correct result.
Types Of Rounding: Half Up, Half Away From Zero, And Half To Even
Half up rounds 0.5 to the next higher integer.5 becomes -1. This is the method taught in Common Core standards 3.NBT.A.1, 4.NBT.A.3, and 5.NBT.A.4. It introduces an upward bias in large datasets because every tie moves the result in the same direction.
Half away from zero rounds 0.5 away from zero.5 becomes -2. For positive numbers it matches half up. For negative numbers it differs. Excel's ROUND function uses half away from zero. JavaScript's Math.round(), specified in ECMA-262 section 20.2.2.21, also rounds half away from zero.
Half to even, also called banker's rounding, rounds ties to the nearest even integer. 2.5 rounds to 2, and 3.5 rounds to 4. Python's round() uses this method. IEEE 754-2019 roundTiesToEven is the default direction attribute for binary floating-point arithmetic. This method eliminates the cumulative upward bias that half up produces.
Round Half Up Vs Half Even
The difference is visible on 2.5: half up gives 3, half even gives 2. On 3.5 both methods give 4. The divergence happens only on ties, and only when the result would be odd under half up. For a single number the difference is one unit. Over thousands of transactions the bias accumulates and changes totals.
Truncate Vs Round
Truncation discards digits without considering their value. Trunc(1.9) = 1, trunc(-1.9) = -1. Rounding considers the discarded digit and changes the result accordingly. Excel's TRUNC function truncates toward zero. Excel's ROUND function rounds half away from zero. The difference matters most for negative numbers: trunc(-1.5) = -1, but round(-1.5) = -2 in Excel.
Ceiling Vs Floor And Truncation
Ceiling rounds toward positive infinity. Ceil(1.1) = 2, ceil(-1.1) = -1. Excel's CEILING.MATH rounds toward positive infinity. Floor rounds toward negative infinity. Floor(1.1) = 1, floor(-1.1) = -2. Excel's FLOOR.MATH rounds toward negative infinity. Truncation rounds toward zero. Excel's TRUNC drops the fractional part entirely.
The difference between ceiling and floor appears on negative numbers. Ceiling(-1.5) = -1, floor(-1.5) = -2. Truncation(-1.5) = -1. If you need to round a negative number and expect the result to be closer to positive infinity, use ceiling. If you need the result closer to negative infinity, use floor. If you need to discard the fractional part, use truncation.
Rounding Algorithm Behavior On 2.5, -2.5, 3.5, And 2.45
45 → 2 (since 2.45 is not a tie).5 → -3, 3.45 → 2. Ceiling: 2.Floor: 2.5 → -2, 3.
The only number where all methods agree is 2.45, which is not exactly halfway. The disagreements happen on ties and on negative numbers. A rounding algorithm that behaves one way on a positive tie may reverse direction on a negative tie.
Which Rounding Method Is Used Where
Schools teach round half up. Common Core standards for grades 3 through 5 specify half up for rounding whole numbers and decimals. Students who later program in Python or use IEEE 754 systems encounter a different default and assume their code is wrong.
Finance often uses round half up for legal and accounting standards. Tax authorities expect consistent rules. Some statistical reports use round half even to reduce bias. Excel's ROUND function, used heavily in finance, rounds half away from zero. Banker's rounding appears in financial contexts where cumulative bias must be minimised.
Science follows round half even. NIST SP 811 section 7.14 specifies that when the digit to be dropped is exactly 5 with no nonzero digits following, round to the nearest even digit. OpenStax Chemistry 2e section 1.5 applies this rule for significant figures. Analytical chemistry, physics, and data science use half even to avoid systematic errors when averaging measurements.
Programming defaults vary. Python's round() uses half even. JavaScript's Math.round() uses half away from zero. .NET's Math.Round offers a MidpointRounding enum with five options. IEEE 754-2019 section 4.3 defines five rounding-direction attributes: roundTiesToEven, roundTiesToAway, roundTowardZero, roundTowardPositive, roundTowardNegative. The default for binary arithmetic is roundTiesToEven.
Floating-Point Surprises With 1.005
In IEEE 754 binary64, 1.005 is stored as 1.0049999999999999. The rounding algorithm sees a value below the tie point and returns 1.00. The same problem occurs for 0.1 + 0.2, which equals 0.30000000000000004, not 0.3.
The failure mode is called the floating-point surprise. The displayed number and the stored number differ. Rounding the stored value gives a different result than rounding the displayed value. This affects any rounding algorithm, not just half up. The workaround is to add a small epsilon before rounding, or to use decimal arithmetic libraries that represent numbers exactly.
The precision illusion: rounding 0.00149 to two decimal places gives 0.00, which has zero significant figures. Rounding the same number to two significant figures gives 0.0015. Decimal places count from the decimal point. Significant figures count from the first non-zero digit. Confusing the two produces a result with the wrong number of meaningful digits.
Rounding To A Multiple And The Carry Collapse
Rounding to a multiple uses the formula round(N / S) × S. Excel's MROUND rounds to the nearest multiple, with ties rounding away from zero. MROUND(1.125, 0.25) = 1.25. Python's round(1.125 / 0.25) * 0.25 gives 1.0 because Python's round() uses half even and the intermediate value 4.5 rounds to 4. […] This is not a rounding error. […] This is the standard for binary floating-point arithmetic.
How do I round to a specific multiple like 0.25? Use the formula round(N / multiple) * multiple. […] The result depends on the tie-breaking rule of your rounding function. Python's round() and Excel's MROUND can give different results on ties.
Why does 1.005 round to 1.00 instead of 1.01? In IEEE 754 binary64, 1.005 is stored as 1.0049999999999999. The rounding function sees a value below the tie point and rounds down. This is a floating-point representation error, not a rounding error.
What is the difference between rounding to decimal places and significant figures? Decimal places count digits after the decimal point. Significant figures count all non-zero digits plus zeros between them or after the decimal point that are indicated as significant. Rounding 0.01499 to one decimal place gives 0.0. […] That includes students following Common Core standards for rounding, high-school chemistry and physics students applying significant-figure rules from OpenStax Chemistry 2e, parents checking homework, office users who want to understand […] specific jurisdiction. VAT rounding in the EU follows local revenue authority rules, not the rounding methods described here. […] Those topics belong in texts like Numerical Recipes or the IEEE 754-2019 standard itself.
The most common failure: assuming every tool uses half up. Check the documentation for the negative-number behavior and the tie-breaking rule before you trust a result.
Frequently Asked Questions
What is the difference between round half up and round half away from zero?
For positive numbers they are identical. For negative numbers, half up rounds -1.5 to -2, while half away from zero rounds -1.5 to -2. The distinction matters when your data includes negative ties.
Why does Python's round() give a different result than JavaScript's Math.round()?
Python's round() uses round half to even. 2.5 becomes 2. JavaScript's Math.round() uses round half away from zero.For 3.5 both give 4.
Does Excel's ROUND function use round half up?
No. Excel's ROUND function uses round half away from zero. For positive numbers the result is the same as half up. For negative numbers it differs. ROUND(-1.5) returns -2.
What is the default rounding mode for IEEE 754-2019?
The default is roundTiesToEven, also called banker's rounding. It rounds ties to the nearest even integer. This is the standard for binary floating-point arithmetic.
How do I round to a specific multiple like 0.25?
Use the formula round(N / multiple) * multiple. In Excel use MROUND. The result depends on the tie-breaking rule of your rounding function. Python's round() and Excel's MROUND can give different results on ties.
Why does 1.005 round to 1.00 instead of 1.01?
In IEEE 754 binary64, 1.005 is stored as 1.0049999999999999. The rounding function sees a value below the tie point and rounds down. This is a floating-point representation error, not a rounding error.
What is the difference between rounding to decimal places and significant figures?
Decimal places count digits after the decimal point. Significant figures count all non-zero digits plus zeros between them or after the decimal point that are indicated as significant. Rounding 0.01499 to one decimal place gives 0.0. Rounding to two significant figures gives 0.015.