(* recursive version of factorial type #use "fact1.ml";; to load this file into ocaml *) let fact n = let (* if n >= 0, then fct n returns n factorial *) rec fct n = if n = 0 then 1 else n * fct(n - 1) in if n < 0 then -1 else fct n (* try: fact 6;; *)