Skip to content

Instantly share code, notes, and snippets.

@tbl3rd
Created September 9, 2020 18:20
Show Gist options
  • Save tbl3rd/f7f9033c64db26aa5a60a694d70524ba to your computer and use it in GitHub Desktop.
Save tbl3rd/f7f9033c64db26aa5a60a694d70524ba to your computer and use it in GitHub Desktop.
(defn f [x n] (if (> x 1) n (recur (+ x (rand)) (+ 1 n))))
(defn e [n] (reduce + (repeatedly n #(f 0.0 0))))
(e 100000000) ;; 271828198 YMMV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment