Guest User

Untitled

a guest
Jan 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. fun gcd(x,y) = let val p_x= ref x; val p_y = ref y; val temp = ref 0 in
  2. while not (!p_x = !p_y) do
  3. (if (!p_x > !p_y) then (temp := !p_x; p_x := !p_y ; p_y := (!temp - !p_y)) else p_y := (!p_y - !p_x));
  4. !p_x
  5. end;
Add Comment
Please, Sign In to add comment