partial recursivity
[calc.git] / calc.c
diff --git a/calc.c b/calc.c
index 6bac59e91cd662c72add8f7b263e941a132da809..cad608fe528f52bfcded3425a3c4bc5f5a595da3 100644 (file)
--- a/calc.c
+++ b/calc.c
@@ -412,4 +412,7 @@ int main (int argc, char *argv[])
 // Gold number
 // test: echo -e '{sto (1, 1), sto (2, 1), sto (10, 1), while (inc (10) < 15 - 1, {sto (3, rcl (1) + rcl (2)), sto (1, rcl (2)), print (sto (2, rcl (3)) / rcl (1))})};' | calc.exe | grep -q '=> 1.61803'
 
+// Factorial sequence
+// test: echo -e 'prog (1, cond (arg (1) > 1, arg (1) * call (1, arg (1) - 1), 1))\ncall (1, 10)' | ./calc.exe | grep -q '=> 3628800'
+
 /* vim: set ts=4 sw=4 et: */