Quick actions

cmd+k|ctrl+k

Navigation

Languages

Extended Euclidean algorithm

Snippet info

Language

Python

Visibility

public

Author

super2bai

Created

2016-12-05T08:20:11Z

Updated

2016-12-05T08:20:11Z

def ext_euclid (a,b):
     if (b == 0):
         return 1, 0, a
     else:
         x , y , q = ext_euclid( b , a % b )
         x , y = y, ( x - (a // b) * y )
         return x, y, q
         
x,y,q=ext_euclid(3120,17)       
print(x)
print(y)
print(q)
INFO