GCD & LCM Calculator
Ita shuwa kuti unoziva kuti ndeipi nhamba inonyanya kuzivikanwa uye ndeipi inonyanya kuzivikanwa.
Zvinyorwa zvinogadziridzwa paunenge uchinyora.
Nezve iyi kalkulator
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.
Zvimwe zvinobvunzwa zvakanyanya
Sei GCD ino kalkulated?
Inoshandisa algorithm yeEuclid: inoshandura nechinguva iyo yakakura kwazvo nhamba neiyo yakati wandei yekuparadzanisa, kusvika imwe ichiita zero. Iyo imwe ndiyo GCD.
Sei GCD uye LCM zvakasiyana?
Kuti uwane GCD, shandisa GCD × LCM = chigadzirwa chemazita maviri. So LCM = a × b ÷ GCD, izvo zvinotiudza kuti mazita maviri aya anofanira kunge ari maviri.
Chii chinonzi coprime?
Mazita maviri kana anopfuura ari coprime kana makuru ezviuru zvavo ari 1 — havana zvikamu zvakafanana kunze kwe 1. Chirongwa ichi chinotaura izvi kwauri.
Ndinogona here kuisa zvakawanda kupfuura zviuru zviviri zvemadhora?
Separate nhamba dzose ne commas kana zvigaro uye GCD uye LCM zvinodiwa pamusoro pezvose mashoko.
Chii chinonzi GCD uye LCM ye 12, 18 uye 24?
Iyo yakakura kwazvo imwechete divisor ndeye 6 (iyo yakakura kwazvo nhamba imwechete) uye iyo yakanyanya kuomarara imwechete imwechete ndeye 72.
Chii chinonzi pfungwa yechiito?
No. Both the GCD and the LCM are the same regardless of the order you type the numbers in.
API — kushandisa iyi kalkulator kubva code
Nhare iyi calculator semahara JSON endpoint - hapana chikuru zvinodiwa. Kutumira nzvimbo mavara pasi separameter query kana JSON. Chii zvachose chaunoisa kunze chinoshandisa default iyo peji iri rakasviba nayo; parameter isiri yechokwadi inonzi 400, uye haisi zero. Tora yakazara API docs →
Endpoint
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);
Zviratidzo zvemubvunzo ndezvekufungidzira kwechinangwa chekudzidzisa chete, kwete zvemari, zvehutano kana zvemari.