Skip to content

Instantly share code, notes, and snippets.

@amalloy
Forked from ejackson/gist:3989381
Created October 31, 2012 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/3989391 to your computer and use it in GitHub Desktop.
Save amalloy/3989391 to your computer and use it in GitHub Desktop.
(def v (into [] (repeatedly 1e5 #(rand 100))))
(defn rnd [x]
(Math/round x))
(defn prnd [x]
(let [^double x x]
(Math/round x)))
(time (r/fold + (r/map rnd v)))
(time (r/fold + (r/map prnd v)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment