Logarithm with base 2 (log2)


/ Published in: Clojure
Save to your folder(s)

Implementation of base2 logarithm


Copy this code and paste it in your HTML
  1. (defn log2 [n]
  2. (/ (Math/log n) (Math/log 2)))

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.