Example #1
0
 def gcd(q, r): 
     """Returns the greatest common divisor of q and r.
     """
     return algorithm.extended_euclidean(q, r)[0]
Example #2
0
 def gcd(q, r):
     """Returns the greatest common divisor of q and r.
     """
     return algorithm.extended_euclidean(q, r)[0]
Example #3
0
 def gcd_extended(q, r): 
     """Return a tuple (p, a, b) such that p = aq + br, 
     where p is the greatest common divisor.
     """
     return algorithm.extended_euclidean(q, r)
Example #4
0
 def gcd_extended(q, r):
     """Return a tuple (p, a, b) such that p = aq + br,
     where p is the greatest common divisor.
     """
     return algorithm.extended_euclidean(q, r)