เครื่องคิดเลข GCD & LCM
ค้นหาตัวแบ่งที่ใหญ่ที่สุดและตัวคูณที่เล็กที่สุดของรายการตัวเลข
ผลลัพธ์จะปรับปรุงเมื่อคุณพิมพ์
เกี่ยวกับเครื่องคิดเลขนี้
This calculator finds the greatest common divisor (GCD) — the largest number that divides all your values evenly — and the least common multiple (LCM), the smallest number they all divide into. Enter two or more whole numbers separated by commas or spaces and it also tells you whether they are coprime.
The GCD is found with the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing the two until one becomes zero; the other is the GCD. The LCM is then built up pairwise using LCM = a × b ÷ GCD. For 12, 18 and 24 the greatest common divisor is 6 and the least common multiple is 72. When the GCD is 1 the numbers share no common factor and are called coprime.
The GCD is what you use to reduce a fraction to lowest terms, while the LCM gives the common denominator for adding fractions and the period at which repeating cycles line up. The result is the same no matter what order you enter the numbers in.
คำถามที่ถามบ่อย
วิธีการที่ GCD ถูกคำนวณ?
ใช้อัลกอริทึมของยูคลิด: แทนที่ตัวเลขที่ใหญ่กว่าด้วยตัวเลขที่เหลือจากการหารสองตัว จนกว่าตัวเลขหนึ่งจะกลายเป็นศูนย์ ตัวเลขอีกตัวคือ GCD
GCD และ LCM เกี่ยวข้องกันยังไง
สำหรับตัวเลขสองตัว GCD × LCM = ผลรวมของตัวเลขทั้งสองตัว ดังนั้น LCM =a× b ÷ GCD ซึ่งเป็นวิธีที่เครื่องมือขยาย LCM ไปยังรายการทั้งหมด
อะไรคือ coprime หมายความว่าอย่างไร
ตัวเลขสองตัวหรือมากกว่านั้นเป็นจำนวนเฉพาะที่เท่ากัน เมื่อตัวแบ่งที่ใหญ่ที่สุดของมันเท่ากับ 1 - มันไม่มีตัวคูณที่เหมือนกันนอกจาก 1 เครื่องมือจะแสดงให้คุณเห็น
ผมสามารถใส่ตัวเลขมากกว่าสองตัวได้ไหม?
ใช่ แยกตัวเลขด้วยตัวคูณ หรือช่องว่าง และ GCD และ LCM จะถูกคำนวณจากรายการทั้งหมด
อะไรคือ GCD และ LCM ของ 12, 18 และ 24
ตัวแบ่งส่วนรวมที่ใหญ่ที่สุดคือ 6( ตัวเลขที่ใหญ่ที่สุดที่แบ่งทั้งหมดสามตัว) และตัวคูณส่วนรวมที่เล็กที่สุดคือ 72
เลขตามลำดับสำคัญไหม
ไม่ ตัวเลข GCD และ LCM เหมือนกัน ไม่ว่าคุณจะพิมพ์เลขในลำดับใด
API - ใช้เครื่องคิดเลขนี้จากโค้ด
เรียกเครื่องคิดเลขนี้เป็นจุดจบ JSON แบบฟรี - ไม่จำเป็นต้องใช้กุญแจ ส่งค่าในช่องด้านล่างนี้เป็นพารามิเตอร์คำถามหรือ JSON ทุกอย่างที่คุณลบออก จะใช้ค่าปริยายที่หน้านี้ใช้อยู่ พารามิเตอร์ที่ไม่รู้จักคือ 400 และไม่เคยเป็นศูนย์ที่เงียบ อ่านเอกสาร API ทั้งหมด →
จุดสิ้นสุด
GET https://calculator.free/api/v1/gcd-lcm/
curl
curl "https://calculator.free/api/v1/gcd-lcm/?numbers=12, 18, 24"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/gcd-lcm/?" + new URLSearchParams({
"numbers": "12, 18, 24"
}));
const data = await r.json();
console.log(data.results);
ผลลัพธ์เป็นเพียงการประมาณการ สำหรับคำแนะนำทั่วไปเท่านั้น ไม่ใช่การเงิน การรักษา หรือคำแนะนำเกี่ยวกับภาษี