Created
October 22, 2013 05:52
-
-
Save k-payl/7095775 to your computer and use it in GitHub Desktop.
1.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcd' :: Int -> Int -> Int | |
gcd' a b = if (b/=0) then gcd' b (mod a b) else a | |
isPrime :: Integer -> Bool | |
isPrime a = if a==1 then False else iter a 2 | |
iter a n = if (n * n > a) then True else | |
if (mod a n)==0 then False else iter a (n+1) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment