Programming-Idioms

History of Idiom 31 > diff from v21 to v22

Edit summary for version 22 :
New Erlang implementation by user [elbrujohalcon]

Version 21

2016-01-01, 00:27:18

Version 22

2016-01-26, 02:26:09

Idiom #31 Recursive factorial (simple)

Create recursive function f which returns the factorial of non-negative integer i, calculated from f(i-1)

Idiom #31 Recursive factorial (simple)

Create recursive function f which returns the factorial of non-negative integer i, calculated from f(i-1)

Code
f(0) -> 1;
f(I) -> I * f(I - 1).
Comments bubble
No defensive programming_ here.