Sumivo · Mathematics

Rounding Calculator

Compare six exact rounding rules. Use 0 (or integer) for whole numbers, 2 for hundredths, −1 for tens or −2 for hundreds. Half-up means ties away from zero: −2.5 becomes −3, not −2 as with ties toward +∞.

01 / inputs

value
n

02 / result

Half-up (ties away from zero)

3

Rounding unit
10^0
Exact midpoint?
Yes

Calculation trace

  1. 10^0
    Choose the rounding unit
  2. 2 retained units; discarded digits: 5
    Split the magnitude into retained units and a remainder
  3. 2.5 ≈ 3
    Apply half-up

Discarded digits: 5. The discarded magnitude is exactly half of one rounding unit. Half-up ties go away from zero; half-down ties go toward zero; half-even ties keep an even retained integer.

ModeResult
Half-up (ties away from zero)3
Half-down (ties toward zero)2
Half-even (bankers rounding)2
Floor (toward −∞)2
Ceiling (toward +∞)3
Truncate (toward zero)2
    §

    How it works

    The selected decimal place defines a power-of-ten unit. Exact integer division separates retained units from the discarded digits, then compares the remainder with half a unit. All six modes use that same exact comparison. Half-up chooses the nearest value with ties away from zero; half-down chooses the nearest with ties toward zero; half-even chooses the nearest with an even retained integer at a tie. Floor moves toward negative infinity, ceiling toward positive infinity, and truncate toward zero.

    Assumptions & limits

    • Half-up here means the school rule on the magnitude: −2.5 becomes −3. It does not mean ties toward positive infinity, which would make −2.5 become −2. Half-down ties go toward zero, not toward negative infinity.
    • Enter decimal strings or e/E notation, with at most 4096 characters and 2000 coefficient digits. Input and normalized exponents must be between −1000 and 1000. Places must be an integer from −2000 to 2000; 0 or integer means the ones place, −1 tens and −2 hundreds. Invalid inputs are rejected, never clamped.
    • Positive places preserve that many fractional digits, even for zero. Negative zero is normalized. This tool rounds a value to a place; it does not infer measurement precision. Half-even is also called bankers rounding and uses the tie principle of the IEEE default nearest-even mode. This tool uses decimal arithmetic, not a binary IEEE format.
    §

    FAQ

    How do I round a number to two decimal places?
    Enter 2 for decimal places. The tool compares the discarded magnitude with 0.005. With half-up, 0.125 becomes 0.13; half-even makes it 0.12 because the retained 2 is even.
    How do you round negative numbers?
    The direction depends on the rule. At the ones place, −2.5 becomes −3 with half-up and floor, but −2 with half-down, half-even, ceiling and truncate.
    What is bankers rounding?
    Half-even rounding selects the nearest value and breaks exact ties by keeping an even retained integer: 2.5 becomes 2 and 3.5 becomes 4 at the ones place. A value above the midpoint, such as 2.5001, still becomes 3.
    How do I round to the nearest ten or hundred?
    Use −1 decimal places for tens or −2 for hundreds. With half-up, 150 rounded to hundreds is 200. Enter 0 or integer to round to a whole number.
    What is the difference between rounding and truncation?
    Truncation discards the remainder toward zero: −2.9 becomes −2. Nearest rounding uses the remainder to choose a neighbor, so half-up makes −2.9 become −3. Floor always moves toward negative infinity.
    §

    Related calculators

    §

    SOURCES