Definitions

   The factorial of   0   (zero)   is defined as being   1   (unity).
   The   Factorial Function   of a positive integer,    n,    is defined as the product of the sequence:
                 n,   n-1,   n-2,   ...   1 



Task

Write a function to return the factorial of a number.

Solutions can be iterative or recursive.

Support for trapping negative    n    errors is optional.



Related task

   Primorial numbers


push 1
not
in(number)
duplicate 
not        // label a
pointer    // pointer 1
duplicate
push 1
subtract
push 1
pointer
push 1
noop
pointer
duplicate  // the next op is back at label a
 
push 1     // this part continues from pointer 1
noop
push 2     // label b
push 1
rot 1 2
duplicate
not
pointer    // pointer 2
multiply
push 3
pointer
push 3
pointer
push 3
push 3
pointer
pointer    // back at label b
 
pop        // continues from pointer 2
out(number)
exit