This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Here is the pseudo code for Euclidean Algorithm: 1. Initialize integer m and n 2. Do: m / n , and save remainder 3. Do: m = n, n = remainder 4. If n = 0, end and return m as the GCD 5. Else: repeat step 2 ~ 4 Once you calculated the GCD, divide the numerator and denominator of the original fraction by their GCD, and this will give you the lowest term of the fraction. Yi Wang, Radhika Medury...
View Full Document
This note was uploaded on 11/30/2011 for the course COP 3275 taught by Professor Jonathanliu during the Fall '11 term at University of Florida.
- Fall '11