기본·수학

기본 계산기

사칙연산을 빠르고 간편하게 계산

0
기본 계산기란?

기본 계산기는 더하기(+)·빼기(−)·곱하기(×)·나누기(÷) 등 일상적인 사칙연산을 키패드나 키보드로 빠르게 처리하는 도구입니다. 서버나 외부 라이브러리 없이 브라우저 안에서 직접 수식을 해석해 계산하며, 결과를 이어서 다음 계산의 시작값으로 사용할 수 있는 연속 계산을 지원합니다.

사용 방법

화면의 키패드 버튼을 눌러 숫자와 연산자를 입력하고 = 버튼으로 계산을 실행합니다. C는 전체 지우기, 는 마지막 한 글자 지우기, %는 현재 입력된 숫자를 퍼센트 값(÷100)으로 바꿉니다. 물리 키보드도 그대로 사용할 수 있습니다: 숫자와 + - * /, 소수점은 ., 계산 실행은 Enter, 지우기는 Backspace(한 글자)와 Esc(전체), 퍼센트는 % 키로 입력합니다.

연산자 우선순위

이 계산기는 괄호 버튼이 없는 대신, 수학의 표준 규칙대로 곱하기·나누기(×÷)를 먼저 계산한 뒤 더하기·빼기(+−)를 왼쪽에서 오른쪽으로 계산합니다. 예를 들어 2 + 3 × 4를 입력하면 (2+3)×4=20이 아니라, 3×4=12를 먼저 계산한 뒤 2를 더한 14가 결과로 나옵니다.

입력 예시와 계산 결과
입력계산 순서결과
2 + 3 × 43×4=12 → 2+1214
10 − 4 ÷ 24÷2=2 → 10−28
50 %50 ÷ 1000.5
7 ÷ 00으로 나누기오류
헷갈리는 연산 순서 — "6÷2(1+2)" 논쟁과 퍼센트 버튼의 차이

인터넷에서 종종 화제가 되는 6 ÷ 2(1+2) 같은 식은 사람마다 답을 1 또는 9로 다르게 계산해 논쟁이 벌어지곤 합니다. 괄호 앞에 생략된 곱셈(암묵적 곱셈)을 나눗셈보다 먼저 계산해야 한다고 보면 6÷(2×3)=6÷6=1이 되고, 곱셈과 나눗셈을 같은 우선순위로 보고 왼쪽부터 순서대로 계산하면 (6÷2)×3=3×3=9가 됩니다. 이는 계산기나 사람마다 암묵적 곱셈의 우선순위를 다르게 해석하기 때문에 생기는 표기법의 모호함이지, 어느 한쪽이 명백히 틀린 것은 아닙니다.

이 계산기는 괄호나 암묵적 곱셈 입력 자체를 지원하지 않으므로 이런 모호함이 애초에 발생하지 않습니다. 코드를 확인하면 곱하기·나누기는 같은 우선순위(PREC 값 2)로 두고 더하기·빼기(우선순위 1)보다 먼저 계산하며, 우선순위가 같은 연산자끼리는 입력한 순서(왼쪽에서 오른쪽) 그대로 계산하는 표준 Shunting-yard 방식을 씁니다.

퍼센트(%) 버튼도 계산기마다 동작이 다릅니다. 일부 계산기는 100 + 10 %를 "100의 10%인 10을 더한다"고 해석해 110을 내놓지만, 이 계산기의 %는 직전 입력값 자체를 100으로 나누는 단순 변환만 수행합니다. 코드로 실제 동작을 확인하면, 100 + 10 %를 입력할 경우 10을 0.1로 바꾼 뒤 100과 더하므로 결과는 110이 아니라 100.1입니다. 계산기 종류마다 % 버튼의 동작이 다를 수 있다는 점을 기억해 두면 좋습니다.

What is the Basic Calculator?

A quick arithmetic tool for addition, subtraction, multiplication and division, usable from the on-screen keypad or your physical keyboard. It parses expressions directly in the browser (no server, no external library) and supports chained calculations, letting you continue from a previous result.

How to use it

Tap numbers and operators, then press = to compute. C clears everything, deletes the last character, and % converts the current number to its percentage value (÷100). Keyboard shortcuts: digits and + - * /, . for the decimal point, Enter to compute, Backspace/Esc to delete, and % for percent.

Operator precedence

There are no parentheses buttons; instead, standard math rules apply — multiplication and division first, then addition and subtraction left to right. For example, 2 + 3 × 4 evaluates 3×4=12 first, then adds 2, giving 14 (not 20).

Sample inputs and results
InputOrderResult
2 + 3 × 43×4=12 → 2+1214
10 − 4 ÷ 24÷2=2 → 10−28
50 %50 ÷ 1000.5
7 ÷ 0Division by zeroError
The "6÷2(1+2)" debate and how the percent button differs

Expressions like 6 ÷ 2(1+2) famously produce two different answers, 1 or 9, depending on whether the implicit multiplication before the parenthesis is treated as higher priority than division (giving 6÷6=1) or as equal priority evaluated left to right (giving 3×3=9). This ambiguity comes from notation, not from either answer being wrong.

This calculator doesn't accept parentheses or implicit multiplication, so the ambiguity never arises: multiplication and division share the same precedence and are evaluated strictly left to right using a standard Shunting-yard approach.

The percent button also behaves differently across calculators. Some interpret 100 + 10 % as "add 10% of 100," giving 110. This calculator's % simply divides the currently entered number by 100, so 100 + 10 % converts 10 to 0.1 and adds it to 100, giving 100.1 — not 110.

곱셈과 나눗셈이 덧셈·뺄셈보다 먼저 계산되나요?
네. 이 계산기는 수학의 표준 연산자 우선순위를 따릅니다. 곱하기(×)와 나누기(÷)를 먼저 계산한 뒤, 더하기(+)와 빼기(−)를 왼쪽에서 오른쪽 순서로 계산합니다. 예를 들어 2 + 3 × 4 는 20이 아닌 14로 계산됩니다.
퍼센트(%) 버튼은 어떻게 계산되나요?
% 버튼을 누르면 현재 입력된 숫자를 100으로 나눈 값(퍼센트 값)으로 바꿉니다. 나머지(모듈로) 연산이 아니라 백분율 변환이며, 예를 들어 50을 입력하고 %를 누르면 0.5가 됩니다.
계산 결과에 오차가 생길 수 있나요?
일반적인 사칙연산에서는 오차가 없습니다. 다만 컴퓨터의 부동소수점 연산 특성상 아주 복잡한 소수를 반복 계산하면 미세한 오차가 생길 수 있어, 이를 줄이기 위해 계산 결과를 최대 10자리 유효숫자로 정리해 표시합니다.
6÷2(1+2) 같은 식은 왜 계산기마다 답이 다른가요?
괄호 앞의 생략된 곱셈을 나눗셈보다 먼저 계산하느냐, 곱셈·나눗셈을 같은 우선순위로 보고 왼쪽부터 계산하느냐에 따라 답이 1 또는 9로 갈리는 표기법의 모호함 때문입니다. 이 계산기는 괄호·암묵적 곱셈 입력을 지원하지 않아 이런 모호함이 생기지 않습니다.
100 + 10 %를 입력하면 110인가요, 100.1인가요?
이 계산기는 100.1이 됩니다. %는 직전 입력값을 100으로 나누는 단순 변환만 수행하므로 10이 0.1로 바뀐 뒤 100과 더해집니다. 10%만큼 더한다고 해석해 110을 내놓는 계산기도 있으니 사용 중인 계산기의 % 동작 방식을 확인하는 것이 좋습니다.
Is multiplication/division calculated before addition/subtraction?
Yes. This calculator follows the standard mathematical operator precedence: multiplication (×) and division (÷) are computed first, then addition (+) and subtraction (−) left to right. For example, 2 + 3 × 4 evaluates to 14, not 20.
How does the percent (%) button work?
Pressing % converts the currently entered number by dividing it by 100 (a percentage value), not a modulo operation. For example, entering 50 and pressing % gives 0.5.
Can rounding errors occur in results?
Ordinary arithmetic produces no error. However, due to floating-point behavior, repeated calculations with very complex decimals can introduce tiny errors, so results are trimmed to at most 10 significant digits to reduce this.
Why do calculators disagree on "6÷2(1+2)"?
It's a notation ambiguity: treating the implicit multiplication before the parenthesis as higher priority than division gives 1, while treating multiplication and division as equal priority evaluated left to right gives 9. This calculator doesn't accept parentheses or implicit multiplication, so the ambiguity doesn't occur here.
Does "100 + 10 %" give 110 or 100.1?
On this calculator it gives 100.1. The % button only divides the currently entered number by 100, converting 10 to 0.1 before adding it to 100. Some calculators instead interpret it as "add 10% of the base," yielding 110, so check how your calculator's % button behaves.