Калькулятор 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?
For two numbers, GCD × LCM = the product of the numbers. So LCM = a × b ÷ GCD, which is how the tool extends the LCM across a whole list.
Що означає полірій?
Два або більше чисел є парріум, коли їх найбільший спільний дільник це 1 ♫ Вони не мають спільного фактору, крім 1.
Чи можу я ввести більше двох чисел?
Так. Розділений цілі числа комами або пробілами, а значення GCD і LCM буде обчислено у всьому списку.
Що таке GCD і LCM (12, 18 та 24)?
Найбільший спільний дільник - це 6 (найбільше число, яке ділиться на три), а найменше спільне кратне - 72.
Чи має значення порядок чисел?
Ні. І GCD, і LCM однакові, незалежно від порядку, у якому ви вводите числа.
API ⇩ використовувати цей калькулятор з коду
Викликати цей калькулятор як вільний son ⁄ без потреби у клавіші. Надсилайте значення полів, нижче, як параметри запиту або 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);
Результати - це не фінансові, медичні чи податкові поради, а загальні вказівки.