Better HN
topnewbestaskshowjobs
Log inSign up

xclojure

1 karma · joined Dec 6, 2014 (11y ago) · 3 submissions

Submissions

comment 11y ago · link · parent

Here is a visualization of the number convergence:

(loop [i 1 t [10N] v [1.0]] (if (> i 300) (map (fn [[a b]] (/ a b)) (partition 2 (interleave v t))) (recur (inc i) (conj t (* 10 (last t))) (conj v (+ (* 9 (last v)) (Math/pow 10 i))))))

comment 11y ago · link · parent

Why is it any better/faster than a simple switch case like this in Clojure: #(case % 1 31 2 28 3 31 4 30 5 31 6 30 7 31 8 31 9 30 10 31 11 30 12 31)