summaryrefslogtreecommitdiff
path: root/31-41/33.hs
blob: 52bebbb1d873020f846c591613753891f2ddbd55 (plain) (blame)
1
2
3
4
5
6
7
8
9
myGCD :: Int -> Int -> Int


myGCD a 0 = abs a
myGCD a b = myGCD b (a `mod` b)

coprime :: Int -> Int -> Bool

coprime a b = myGCD a b == 1