progs/fact.rec
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 07 Nov 2014 16:01:50 +0000
changeset 301 e8c0269c8ff5
parent 224 70198792c2aa
permissions -rw-r--r--
update

def fact(n) = if n == 0 then 1 else n * fact(n - 1);

def facT(n, acc) = if n == 0 then acc else facT(n - 1, n * acc);

facT(15, 1)

//fact(15)