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


You need to login to view comments.