Ejemplo n.º 1
0
 def gcd(q, r): 
     """Returns the greatest common divisor of q and r.
     """
     return algorithm.extended_euclidean(q, r)[0]
Ejemplo n.º 2
0
 def gcd(q, r):
     """Returns the greatest common divisor of q and r.
     """
     return algorithm.extended_euclidean(q, r)[0]
Ejemplo n.º 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)
Ejemplo n.º 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)