wmoxam (owner)

Revisions

gist: 220100 Download_button fork
public
Public Clone URL: git://gist.github.com/220100.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/local/bin/ruby
 
def fib(n)
  if n <=1
    1
  else
    fib(n - 1) + fib(n - 2)
  end
end
 
fib(40)
 
$ time ruby19 ../potion/fib.rb
    0m48.66s real 0m47.17s user 0m0.05s system
 
$ more example/fib.pn
fib = (n):
  if (n <= 1): 1. else: fib (n - 1) + fib (n - 2)..
fib (40)
 
$ time ./potion -X example/fib.pn
    0m6.35s real 0m6.31s user 0m0.01s system