Advertisement
Guest User

Untitled

a guest
Aug 13th, 2010
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.12 KB | None | 0 0
  1. (defn bit-count [v]
  2.   (loop [v v
  3.          c 0]
  4.     (if (zero? v)
  5.         c
  6.         (recur (bit-and v (dec v)) (inc c)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement