powered by
Finds the greatest common divisor (GCD) of two integers using the Euclidean algorithm. In addition to the value of GCD, it generates the number of required iterations to find GCD and the sequence of partial quotients.
GCD.q(x, y)
the first integer greater than zero.
the second integer greater than zero.
the number of required iterations to find GCD.
the sequence of partial quotients.
the value of greatest common divisor.
# NOT RUN { result=GCD.q(4535,2451) print(result) result=GCD.q(35,2) print(result) # }
Run the code above in your browser using DataLab