Skip to content

Instantly share code, notes, and snippets.

@mabako
Created October 11, 2013 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mabako/6938959 to your computer and use it in GitHub Desktop.
Save mabako/6938959 to your computer and use it in GitHub Desktop.
erweiterter euklid
(define (erweiterter_euklid a b)
(if (= b 0)
(list a 1 0)
(begin
(let*
(
(tmp (erweiterter_euklid b (modulo a b)))
(d (car tmp))
(s (cadr tmp))
(t (caddr tmp))
(s' (- s (* (/fx a b) t)))
)
(list d t s')
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment