최대공약수·최소공배수 계산기
GCD & LCM Calculator
최대공약수·최소공배수 계산기란?
최대공약수(GCD)는 두 개 이상의 정수를 동시에 나누어 떨어지게 하는 가장 큰 수이고, 최소공배수(LCM)는 그 정수들의 공통 배수 중 가장 작은 수입니다. 이 계산기는 콤마로 구분한 정수 여러 개를 받아 GCD와 LCM을 즉시 계산합니다.
사용 방법
계산할 양의 정수를 콤마(,)로 구분해 2개 이상 입력한 뒤 계산하기를 누릅니다. 예: 12, 18, 24. 소수·음수·0은 입력할 수 없습니다.
공식·계산 과정
유클리드 호제법: GCD(a, b) = GCD(b, a mod b), b가 0이 될 때까지 반복. LCM(a, b) = (a × b) ÷ GCD(a, b). 숫자가 3개 이상이면 두 개씩 순서대로 누적 계산합니다.
| 입력 | GCD | LCM |
|---|---|---|
| 12, 18 | 6 | 36 |
| 12, 18, 24 | 6 | 72 |
What is the GCD & LCM Calculator?
The greatest common divisor (GCD) is the largest number that evenly divides two or more integers, while the least common multiple (LCM) is the smallest number that is a multiple of all of them. This tool accepts comma-separated integers and computes both instantly.
How to use it
Enter two or more positive integers separated by commas, e.g. 12, 18, 24, then press Calculate. Decimals, negatives, and zero are not accepted.
Formula & process
Euclidean algorithm: GCD(a, b) = GCD(b, a mod b), repeated until b is 0. LCM(a, b) = (a × b) ÷ GCD(a, b). For three or more numbers, the result accumulates pairwise in order.
| Input | GCD | LCM |
|---|---|---|
| 12, 18 | 6 | 36 |
| 12, 18, 24 | 6 | 72 |
자주 묻는 질문
최대공약수(GCD)는 어떻게 계산되나요?
최소공배수(LCM)는 어떻게 계산되나요?
음수나 0을 입력해도 되나요?
FAQ
How is the GCD calculated?
How is the LCM calculated?
Can I enter negative numbers or zero?
안내: 본 계산기는 일반적인 수학 계산 결과를 제공합니다. 매우 큰 수를 입력하면 자바스크립트의 안전 정수 범위를 벗어나 오차가 발생할 수 있으므로, 정밀한 검증이 필요한 계산에는 별도 확인을 권장합니다.
Note: This calculator provides standard mathematical results. Extremely large numbers may exceed JavaScript's safe integer range and introduce errors — please double-check figures where precise verification is required.