4 ms·
Not as short as the clojure from the article, but easier to understand (maybe): user> (time (let [limit (.pow (BigInteger/TEN) 999)] (loop [
by nuggien 17y ago
Not as short as the clojure from the article, but easier to understand (maybe):
user> (time (let [limit (.pow (BigInteger/TEN) 999)]
(loop [a 0 b 1 i 1]
(if (< b limit)
(recur b (+ a b) (inc i))
i))))
"Elapsed time: 3.554351 msecs"
4782