Press CTRL+C or CMD+C to copy the selected text and close this dialog.
Tweet
4 people like it. Like the snippet!
Factorial versus tail recursion
1: 2: 3: 4: 5: 6:
let factorial x = let rec util(value, acc) = match value with |0 | 1 -> acc | _ -> util(value - 1, acc * value) util(x,1)