4 ms·
I don´t know Clojure, but it looks like it will give a wrong answer for 0
by hiena03 16y ago
I don´t know Clojure, but it looks like it will give a wrong answer for 0
- jcromartie 16y agoNope. The result of (range 1 0) is an empty range, and when you apply * with no arguments you get 1.
- hiena03 16y agook, thanks, it looks to similar to haskell: factorial n=foldl1 (*) [1..n] that will throw an exception for n<1 because you will have an empty list