factorial



Write a function that computes factorials You can assume that a positive integer is passed in.


Solution

(define (factorial x)
  (if (>= 0 x)
      1
      (* x (factorial (- x 1)))))