Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func isPrime (num : AnyObject?) -> Bool
- {
- if (num is (Int, Int))
- {
- if ((num as! (Int, Int)).0 == 1)
- {
- return true
- }
- if ((num as! (Int, Int)).1 % ((num as! (Int, Int))).0 == 0)
- {
- return false
- }
- }
- if (num is Int)
- {
- return isPrime(num:((num as! Int - 1), num as! Int) as AnyObject?)
- }
- return isPrime(num:(((num as! (Int, Int)).0)-1, ((num as! (Int, Int)).1)) as AnyObject)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement