예제 #1
0
파일: traits.py 프로젝트: hpc12/lec11-demo
 def gcd(q, r): 
     """Returns the greatest common divisor of q and r.
     """
     return algorithm.extended_euclidean(q, r)[0]
예제 #2
0
파일: traits.py 프로젝트: FInAT/pymbolic
 def gcd(q, r):
     """Returns the greatest common divisor of q and r.
     """
     return algorithm.extended_euclidean(q, r)[0]
예제 #3
0
파일: traits.py 프로젝트: hpc12/lec11-demo
 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)
예제 #4
0
파일: traits.py 프로젝트: FInAT/pymbolic
 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)