Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let (|LT|EQ|GT|) (x, y) =
- if x < y then LT
- elif x = y then EQ
- else GT
- 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