summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-03-31 19:47:47 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-03-31 19:47:47 -0700
commit771964ef317c69f1b33f30063f39f6fc68dec818 (patch)
tree7fcd6594289888457629fd99d76bab43d83c2332
parent96fd52af253f2ebb205da4671fcc334e7e7f2aa1 (diff)
parent35ced975dc503649527dd1181652c1fbfa1d3839 (diff)
downloadmruby-771964ef317c69f1b33f30063f39f6fc68dec818.tar.gz
mruby-771964ef317c69f1b33f30063f39f6fc68dec818.zip
Merge pull request #1123 from monaka/pr-add-fib39-to-benchmark
Add fib39.rb to benchmark/
-rwxr-xr-xbenchmark/fib39.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/benchmark/fib39.rb b/benchmark/fib39.rb
new file mode 100755
index 000000000..d5565b779
--- /dev/null
+++ b/benchmark/fib39.rb
@@ -0,0 +1,8 @@
+# Fib 39
+
+def fib n
+ return n if n < 2
+ fib(n-2) + fib(n-1)
+end
+
+puts fib(39)