Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let areCoPrimes x y =
- let rec aux (x, y) =
- match x, y with
- | 0, _ | _, 0 -> false
- | Lt -> aux (x, y - x)
- | Eq -> x = 1
- | Gt -> aux (x - y, y)
- aux (abs x, abs y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement