반올림 계산기
원하는 자리에서 반올림·올림·내림
반올림 계산기란?
지정한 자릿수에서 반올림·올림(切上)·내림(切下)을 계산하는 도구입니다. 소수점 이하 자리뿐 아니라 십의 자리·백의 자리 같은 정수 자릿수 지정도 가능합니다.
사용 방법
값과 자릿수를 입력합니다. 자릿수 2는 소수 둘째 자리까지 남기고, 0은 정수로, −2는 백의 자리에서 처리합니다. 반올림·올림·내림 중 방식을 선택하고 계산하기를 누릅니다.
공식·참고표
계수 factor = 10^자릿수를 사용해 round(value × factor) / factor (올림·내림은 Math.ceil/Math.floor로 치환) 방식으로 계산합니다.
| 자릿수 | 반올림 | 올림 | 내림 |
|---|---|---|---|
| 2 | 1234.57 | 1234.57 | 1234.56 |
| 0 | 1235 | 1235 | 1234 |
| −2 | 1200 | 1300 | 1200 |
반올림 vs 올림 vs 버림 vs 은행가 반올림: 0.5는 왜 처리 방식마다 다르게 갈까
네 가지 방식은 모두 '지정한 자리 다음을 어떻게 처리할지'를 다르게 정합니다. 반올림은 다음 숫자가 5 이상이면 올리고 미만이면 버리며, 올림은 다음 숫자가 0이 아니면 무조건 위로, 버림(내림)은 다음 숫자를 무조건 잘라냅니다. 세 방식은 12.34처럼 다음 숫자가 정확히 5가 아닐 때는 결과가 갈리지 않는 경우도 많지만, 정확히 .5로 끝나는 값에서 반올림의 동작이 특히 논쟁적입니다.
일반적인 사사오입 반올림(이 계산기가 쓰는 방식)은 .5를 항상 위로 올립니다: 0.5→1, 1.5→2, 2.5→3, 3.5→4, 4.5→5. 하지만 은행가 반올림(banker's rounding, 짝수 반올림)은 .5를 가장 가까운 짝수로 반올림합니다: 0.5→0, 1.5→2, 2.5→2, 3.5→4, 4.5→4. 두 방식이 갈리는 지점은 정수부가 짝수일 때(0.5, 2.5, 4.5)뿐이며, 정수부가 홀수인 1.5나 3.5는 두 방식 모두 같은 결과를 냅니다.
이 차이가 실무에서 중요한 이유는, .5로 끝나는 값이 많이 몰린 데이터를 사사오입으로 처리하면 항상 위쪽으로만 쏠려 누적 오차가 생기기 때문입니다. 은행가 반올림은 위·아래로 고르게 분산시켜 이 누적 편향을 줄이는 목적으로 회계·통계 소프트웨어(예: 엑셀의 일부 함수, 파이썬 3의 기본 round())에서 채택됩니다. 이 계산기는 이해하기 쉬운 일반적인 사사오입 방식을 사용합니다.
What is the Rounding Calculator?
A tool for computing round, ceil, and floor at any specified digit — not just decimal places, but also tens, hundreds, and other integer place values.
How to use it
Enter a value and a digit. A digit of 2 keeps two decimal places, 0 rounds to an integer, and −2 operates at the hundreds place. Choose round, ceil, or floor, then press Calculate.
Formula & reference
Using a factor factor = 10^digit, the result is round(value × factor) / factor (substituting Math.ceil/Math.floor for ceil/floor mode).
| Digit | Round | Ceil | Floor |
|---|---|---|---|
| 2 | 1234.57 | 1234.57 | 1234.56 |
| 0 | 1235 | 1235 | 1234 |
| −2 | 1200 | 1300 | 1200 |
Round vs. ceil vs. floor vs. banker's rounding — why 0.5 splits opinions
All four methods differ only in how they treat what comes after the specified digit. Round rounds up if the next digit is 5 or greater and down otherwise; ceil always rounds up if anything nonzero remains; floor always truncates whatever follows. These three often agree when the next digit isn't exactly 5, but rounding behavior gets genuinely contested for values that end exactly at .5.
Standard "round half up" (the method this calculator uses) always rounds .5 upward: 0.5→1, 1.5→2, 2.5→3, 3.5→4, 4.5→5. Banker's rounding (round half to even), however, rounds .5 to the nearest even integer: 0.5→0, 1.5→2, 2.5→2, 3.5→4, 4.5→4. The two methods only diverge when the integer part is even (0.5, 2.5, 4.5) — for an odd integer part like 1.5 or 3.5, both methods agree.
This distinction matters in practice because rounding a dataset heavily populated with .5 values always upward with standard rounding introduces a cumulative upward bias. Banker's rounding spreads the rounding direction evenly up and down to cancel out that bias, which is why accounting and statistical software — including some Excel functions and Python 3's built-in round() — adopt it. This calculator uses the simpler, more familiar round-half-up method.