Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

(´∀`) Prime numbers (,,゚Д゚)

Name: Anonymous 2007-04-15 11:11 ID:00E9fssW

|code]isPrime x = (filter (0 ==) (map (mod x) [2..x-1])) == [][/code]

Name: Anonymous 2007-04-15 11:37 ID:s5txUzY+

isPrime x = divs x 2 where divs x y = if x == y then True else if mod x y == 0 then False else divs x (y + 1)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List