OSDN Git Service

ruby-1.9.1-rc1
[splhack/AndroidRuby.git] / lib / ruby-1.9.1-rc1 / benchmark / other-lang / fib.scm
diff --git a/lib/ruby-1.9.1-rc1/benchmark/other-lang/fib.scm b/lib/ruby-1.9.1-rc1/benchmark/other-lang/fib.scm
new file mode 100644 (file)
index 0000000..2fc4e22
--- /dev/null
@@ -0,0 +1,7 @@
+(define (fib n)
+        (if (< n 3)
+            1
+          (+ (fib (- n 1)) (fib (- n 2)))))
+
+(fib 34)
+