공학용 계산기
삼각함수·로그 등 고급 연산 지원
공학용 계산기란?
공학용 계산기는 일반적인 사칙연산에 더해 삼각함수·로그·제곱근·거듭제곱·팩토리얼·괄호 연산 등 이공계·공학 분야에서 자주 쓰는 함수를 키패드나 키보드로 계산하는 도구입니다. 서버나 외부 라이브러리 없이 브라우저 안에서 직접 수식을 해석해 계산하며(eval 미사용), 괄호를 활용한 복잡한 식도 연산자 우선순위대로 정확히 처리합니다.
지원 함수
sin·cos·tan은 삼각함수이며, 상단의 DEG/RAD 버튼으로 각도(도, °) 단위와 라디안 단위를 전환할 수 있습니다. log는 밑이 10인 상용로그, ln은 밑이 자연상수 e인 자연로그입니다. √는 제곱근, x²는 제곱, x^y는 임의의 거듭제곱(우결합, 최고 우선순위)을 계산합니다. n!(팩토리얼)은 0 이상의 정수에서만 계산되며, π·e는 각각 원주율과 자연상수를 즉시 입력합니다.
사용 방법
화면의 키패드 버튼을 눌러 숫자·함수·연산자를 입력하고 = 버튼으로 계산을 실행합니다. C는 전체 지우기, ←는 한 글자 지우기, ±는 부호 반전, %는 퍼센트 변환입니다. 물리 키보드도 사용할 수 있습니다: 숫자와 + - * / ^ ( ), 소수점은 ., 계산 실행은 Enter, 지우기는 Backspace(한 글자)와 Esc(전체), 팩토리얼은 ! 키로 입력합니다.
| 입력 | 모드 | 결과 |
|---|---|---|
| sin(30) | DEG | 0.5 |
| log(100) | - | 2 |
| √(16) | - | 4 |
| 2^10 | - | 1024 |
| 5! | - | 120 |
DEG·RAD 모드 함정과 부동소수점 한계, 검산으로 확인
공학용 계산기에서 가장 흔한 실수 중 하나가 DEG·RAD 모드를 헷갈리는 것입니다. DEG 모드에서 sin(30)을 계산하면 30°를 라디안(30×π/180≈0.5236)으로 변환한 뒤 사인 함수를 적용해 0.5가 나옵니다. 그런데 RAD 모드에서 같은 sin(30)을 계산하면 30을 각도가 아닌 라디안 값 그대로 사용하므로, 결과는 전혀 다른 약 −0.988이 됩니다. 각도(°) 단위로 값을 입력하면서 모드를 RAD로 두면 부호까지 뒤바뀐 엉뚱한 값을 얻을 수 있으니, 계산 전 상단의 DEG/RAD 표시를 항상 확인하는 것이 좋습니다.
부동소수점 한계도 잘 알려진 함정입니다. 컴퓨터는 0.1이나 0.2 같은 십진 소수를 이진수로 정확히 표현하지 못해, 이론적으로는 0.1 + 0.2를 계산하면 0.3이 아니라 0.30000000000000004 같은 미세한 오차가 섞인 값이 나옵니다. 이 계산기는 모든 연산 결과를 최대 10자리 유효숫자로 정리(roundSig)해 표시하므로, 실제로 0.1+0.2를 입력하면 오차가 정리된 0.3이 화면에 나타나 이 함정이 겉으로 드러나지 않도록 보정합니다.
결과 표시는 공학 표기법(지수 표기)으로 자동 전환되지 않고 항상 일반 십진 표기를 사용합니다. 예를 들어 2^100을 계산하면 1.27e+30처럼 축약되지 않고 1,267,650,600,228,229,400,000,000,000,000처럼 자릿수가 그대로 풀어져 표시되므로, 매우 크거나 작은 값을 다룰 때는 화면에 긴 숫자가 나타날 수 있다는 점을 참고하세요.
What is the Scientific Calculator?
Beyond standard arithmetic, this tool computes trigonometric, logarithmic, root, power, factorial, and parenthesized expressions common in engineering and science. It parses expressions directly in the browser (no server, no external library, no eval) and correctly applies operator precedence even with nested parentheses.
Supported functions
sin, cos, tan are trigonometric functions; toggle DEG/RAD at the top to switch between degrees and radians. log is base-10 logarithm, ln is natural logarithm (base e). √ computes square root, x² squares, and x^y raises to any power (right-associative, highest precedence). n! (factorial) is defined only for non-negative integers, and π/e insert the respective constants instantly.
How to use it
Tap numbers, functions, and operators, then press = to compute. C clears everything, ← deletes the last character, ± flips the sign, and % converts to a percentage. Keyboard shortcuts: digits and + - * / ^ ( ), . for the decimal point, Enter to compute, Backspace/Esc to delete, and ! for factorial.
| Input | Mode | Result |
|---|---|---|
| sin(30) | DEG | 0.5 |
| log(100) | - | 2 |
| √(16) | - | 4 |
| 2^10 | - | 1024 |
| 5! | - | 120 |
DEG/RAD pitfalls and floating-point limits — verified by hand
Mixing up DEG and RAD mode is one of the most common scientific-calculator mistakes. In DEG mode, sin(30) converts 30° to radians (30×π/180≈0.5236) first, giving 0.5. In RAD mode, the same sin(30) treats 30 as radians directly, giving a completely different result of about −0.988. Entering a degree value while the mode is set to RAD can flip the sign entirely, so always check the DEG/RAD indicator before computing.
Floating-point limits are another well-known pitfall: computers can't represent decimals like 0.1 or 0.2 exactly in binary, so 0.1 + 0.2 theoretically yields 0.30000000000000004 rather than 0.3. This calculator rounds every result to at most 10 significant digits (roundSig), so entering 0.1+0.2 here shows a clean 0.3.
Results are always shown in plain decimal notation and never switch to scientific (exponential) notation. For example, 2^100 displays as the full digit string 1,267,650,600,228,229,400,000,000,000,000 rather than 1.27e+30, so very large or small results can appear as long strings of digits.