# All Questions

112401 views

### How to find GCD, LCM on a set of numbers

What would be the easiest way to calculate Greatest Common Divisor and Least Common Multiple on a set of numbers? What math functions can be used to find this information?
27475 views

### Euclidean algorithm (GCD) with multiple numbers?

So I'm writing a program in Python to get the GCD of any amount of numbers. def GCD(numbers): if numbers[-1] == 0: return numbers[0] # i'm stuck here, this is wrong for i in ra...
35186 views

### what is the fastest way to find the gcd of n numbers?

what is the fastest way to compute the greatest common divisor of n numbers?
144643 views

### Java: get greatest common divisor

I have seen that such a function exists for BigInteger, i.e. BigInteger#gcd. Are there other functions in Java which also works for other types (int, long or Integer)? It seems this would make sense a...
8300 views

### How does the Euclidean Algorithm work?

I just found this algorithm to compute the greatest common divisor in my lecture notes: public static int gcd( int a, int b ) { while (b != 0) { final int r = a % b; a = b; ...
6671 views

### "Approximate" greatest common divisor

Suppose you have a list of floating point numbers that are approximately multiples of a common quantity, for example 2.468, 3.700, 6.1699 which are approximately all multiples of 1.234. How would y...
51849 views

### GCD function in c++ sans cmath library

I'm writing a mixed numeral class and need a quick and easy 'greatest common divisor' function. Can anyone give me the code or a link to the code?
11062 views

### Euclidean greatest common divisor for more than two numbers

Can someone give an example for finding greatest common divisor algorithm for more than two numbers? I believe programming language doesn't matter.