Recursive function a little bit to recursive

Infinitely recursive
This commit is contained in:
Oscar 2014-10-18 11:44:44 +08:00
parent 8e723a5f45
commit b2cb538a5a

View File

@ -93,7 +93,7 @@ let inc_int (x: int) : int = x + 1 ;;
(* You need to mark recursive function definitions as such with "rec" keyword. *)
let rec factorial n =
if n = 0 then 1
else factorial n * factorial (n-1)
else n * factorial (n-1)
;;
(* Function application usually doesn't need parentheses around arguments *)