summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/bc/Test/fact.b
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/bc/Test/fact.b')
-rw-r--r--gnu/usr.bin/bc/Test/fact.b13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnu/usr.bin/bc/Test/fact.b b/gnu/usr.bin/bc/Test/fact.b
new file mode 100644
index 00000000000..8d1474702bd
--- /dev/null
+++ b/gnu/usr.bin/bc/Test/fact.b
@@ -0,0 +1,13 @@
+define f (x) {
+
+ if (x<=1) return(1)
+ return (f(x-1)*x)
+}
+
+"Here we go"
+for (a=1; a<100; a++) b+=f(a)/a
+"
+"
+"b=";b
+quit
+