# Finding gcd of real numbers

I know how to find gcd of integers I can find the positive common divisors of given integers then can choose the greatest common divisor or using The Euclidean algorithm Can I find gcd of two rational numbers? What about irrational numbers?

• How would you define a divisor of, say $\frac12$? – John Doe Feb 10 '18 at 1:50
• In order to talk about the greatest common divisor one needs a definition of divisibility (i.e. some way of telling a divisor from a non-divisor). – lanskey Feb 10 '18 at 1:50
• Can I do it like (0.5,3.5)=0.5(1,7)=0.5? – user529392 Feb 10 '18 at 2:25
• @John Doe Divisors of 0.5 , 0.1,0.2,0.25,0.5 maybe? – user529392 Feb 10 '18 at 2:33
• Again, it really depends on what you want "divisibility" to mean in this context. For natural numbers, the concept of divisibility I feel to be pretty natural. I have trouble thinking of an interesting notion of divisibility for irrational numbers. – Dan Feb 10 '18 at 2:37

The Euclidean algorithm will find the gcd of two commeasurable real numbers, otherwise the algorithm will never stop. Euclid originally gave his algorithm in his Elements Book 7 for "magnitudes" and Book 10 for positive integers. The algorithm will stop for two rationals because you can always get a common denominator for them. The Wikipedia article Euclidean algorithm has much more detailed information if you are interested in knowing more.

• Thank you I will check that – user529392 Feb 10 '18 at 10:07

I studied about gcd and lcm of rational numbers in my school.

As @Ianskey has pointed out─ In order to talk about the greatest common divisor one needs a definition of divisibility (i.e. some way of telling a divisor from a non-divisor). My authors started with following definition of divisibility.

If two rational numbers $\frac{a}{c}$ and $\frac{b}{d}$ satisfy the following equality for some integer $m$, $$\frac{a}{c}=m \times \frac{b}{d}$$ then we say $\frac{a}{c}$ is divisible by $\frac{b}{d}$.

$\frac{a}{c}$ is the multiple and $\frac{b}{d}$ is the divisor.

Now see, imagining $\frac{a}{c}$ and $\frac{b}{d}$ are in reduced form, $m=\frac{a}{c} \div \frac{b}{d} = \frac{a}{c} \times \frac{d}{b}$ is an integer if and only if

1. $a$ is a multiple of $b$ and
2. $d$ is a multiple of $c$.

From the above two points are the following definitions of gcd and lcm of two rational numbers.

$$gcd(\frac{x}{y},\frac{g}{h}) = \frac{gcd(x,g)}{lcm(y,h)}$$

$$lcm(\frac{x}{y},\frac{g}{h}) = \frac{lcm(x,g)}{gcd(y,h)}$$

I do not know about the irrational part.

Note: Each of $a, b, c, d, x,y,g$ and $h$ is an integer.