Skip to content

Instantly share code, notes, and snippets.

View vrachnis's full-sized avatar

vrachnis vrachnis

View GitHub Profile
#!/usr/bin/env python
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
print a, b, d, x, y
return d, x, y