about summary refs log tree commit diff stats
path: root/factorial.mu
diff options
context:
space:
mode:
Diffstat (limited to 'factorial.mu')
-rw-r--r--factorial.mu2
1 files changed, 2 insertions, 0 deletions
diff --git a/factorial.mu b/factorial.mu
index 25ab1eba..ee928e86 100644
--- a/factorial.mu
+++ b/factorial.mu
@@ -2,10 +2,12 @@
   ((default-scope scope-address) <- new (scope literal) (30 literal))
   ((n integer) <- arg)
   { begin
+    ; if n=0 return 1
     ((zero? boolean) <- eq (n integer) (0 literal))
     (break-unless (zero? boolean))
     (reply (1 literal))
   }
+  ; return n*factorial(n-1)
   ((x integer) <- sub (n integer) (1 literal))
   ((subresult integer) <- factorial (x integer))
   ((result integer) <- mul (subresult integer) (n integer))