Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Update src/koans/13_recursion.clj

Made a separate function for the factorial function applied to bigints.

The reason for this is that after successfully implementing a solution for the "Simple things may appear simple." koan and the other non-bigint factorial koans, the `script/run` application throws a java.lang.StackOverflowError.  Instead, it should signal to the user that he's working on the next koan.
  • Loading branch information...
commit 514e17f69c4963fefc07e151f1c2222fc1282394 1 parent 626f97d
eric-hu authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/koans/13_recursion.clj
7 src/koans/13_recursion.clj
@@ -16,6 +16,9 @@
(defn factorial [n]
+(defn factorial-bigint [n]
+ __)
"Recursion ends with a base case"
(= true (is-even? 0))
@@ -45,7 +48,7 @@
(= 24 (factorial 4))
"You can even deal with very large numbers"
- (< 1000000000000000000000000N (factorial 1000N))
+ (< 1000000000000000000000000N (factorial-bigint 1000N))
"But what happens when the machine limits you?"
- (< 1000000000000000000000000N (factorial 100003N)))
+ (< 1000000000000000000000000N (factorial-bigint 100003N)))
Please sign in to comment.
Something went wrong with that request. Please try again.