Pastebin

Paste #603: recursive extended gdc

< previous paste - next paste>

Pasted by tdn

Download View as text

def extended_gcd_recursive(a, b):
    if (a % b) == 0:
        return (0, 1)
    else:
        tmp = extended_gcd(b, a % b)
        x = tmp[0]
        y = tmp[2]
        return (y, x - y * (a / b))

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.