Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 308 Bytes
(defn compute-pi
[n]
(loop [pi 4.0
i 3]
(if (< i (+ n 2))
(recur (* pi (/ (- i 1) i) (/ (+ i 1) i))
(+ i 2))
pi)))
(loop [n 1]
(print n "\t")
(println (compute-pi n))
(if (< n 500000)
(recur (* n 2))))
You can’t perform that action at this time.