Skip to content

Instantly share code, notes, and snippets.

@trevordixon
Created October 9, 2013 03:34
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 trevordixon/6895802 to your computer and use it in GitHub Desktop.
Save trevordixon/6895802 to your computer and use it in GitHub Desktop.
Extended euclidean algorithm in Haskell
extendedEu :: Integer -> Integer -> (Integer, Integer)
extendedEu a 0 = (1, 0)
extendedEu a b = (t, s - q * t)
where (q, r) = quotRem a b
(s, t) = extendedEu b r
@Peter-Bergman
Copy link

I understand that q and r stand for quotient and remainder respectively. What do s and t stand for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment