I want to calculate !1000 in clojure, how can I do this without getting a integer-overflow exception?
!1000
My factorial code is right now: (reduce * (range 1 1001)).
(reduce * (range 1 1001))
You could use the *' operator which supports arbitrary precision by automatically promoting the result to BigInt in case it would overflow:
*'
(reduce *' (range 1 1001))
2.1m questions
2.1m answers
60 comments
57.0k users