Computer Science Canada

Lowest Common Denominator in Turing

Author:  Grim [ Thu Nov 18, 2010 3:46 pm ]
Post subject:  Lowest Common Denominator in Turing

What is it you are trying to achieve?
How would I find a lowest common denominator in Turing? I need to add fractions and can't find the lowest common denominator


Describe what you have tried to solve this problem
I tried a for loop, so if the first denominator not = the other, multiply the first one by i until they were equal, elsif the first one is greater than the second, multiply the second by i, but this didn't work. Instead of getting 1x1 *check* 1x2 *check* I got 1x2x3x4x5... Which obviously didn't work. Any way of finding an LCD easily?

Author:  DtY [ Thu Nov 18, 2010 4:15 pm ]
Post subject:  RE:Lowest Common Denominator in Turing

Despite what math teachers have told you, you don't need the lowest common denominator. You just need a common denominator. The easiest way to get that is to multiply the denominators together.

However, if you do not take the lowest common denominator, you will need to reduce the resulting fraction, ie. find the greatest common divisor. Which is much easier to do. See Euclid's Algorithm.


: