Skip to content

Instantly share code, notes, and snippets.

@chomy
Created August 28, 2012 15:57
Show Gist options
  • Save chomy/3499421 to your computer and use it in GitHub Desktop.
Save chomy/3499421 to your computer and use it in GitHub Desktop.
factrial in OCaml
let fact n
let rec fact_ite n t =
if n = 0 then t
else fact_ite (n-1) (n*t);;
in
fact_ite n 1;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment