Arc Forumnew | comments | leaders | submitlogin
1 point by parenthesis 6132 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 6130 days ago | link

-- Actually, spot the bug!

-----