d = ax + by
def euclidExtended(a, b): if b == 0: return a, 1, 0 dd, xx, yy = euclidExtended(b, a % b) d, x, y = dd, yy, xx - int(a / b) * yy return d, x, y
11380 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
def euclidExtended(a, b): if b == 0: return a, 1, 0 dd, xx, yy = euclidExtended(b, a % b) d, x, y = dd, yy, xx - int(a / b) * yy return d, x, y
You need to create an account or log in to post comments to this site.