Arc Forumnew | comments | leaders | submitlogin
1 point by parenthesis 6171 days ago | link | parent

  (def prime (n)
    (if (~isa n 'int) nil
        (< (= n (truncate n)) 2) nil
        (is n 2) t
        (multiple n 2) nil
        (with (div 3
               lim (truncate (sqrt n))
               result t)
          (while (and (or (~multiple n div)
                          (= result nil))
                      (< div lim))
            (++ div 2))
          result)))


1 point by parenthesis 6169 days ago | link

-- Actually, spot the bug!

-----