(defn factorial
"
Returns the factorial of k (k must be a positive integer). Equivalent to R's
factorial function.
Examples:
(factorial 6)
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/math/tdouble/DoubleArithmetic.html
http://en.wikipedia.org/wiki/Factorial
"
([^Integer k] {:pre [(and (number? k) (pos? k))]} (DoubleArithmetic/factorial k)))
Comments top
No comments for factorial. Log in to add a comment.