summaryrefslogtreecommitdiff
path: root/jni/ruby/benchmark/other-lang/fact.rb
blob: 6cedc752cd4f16de06bd74f77c6a0d4ad53cfe1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
def fact(n)
  if n < 2
    1
  else
    n * fact(n-1)
  end
end

i = 0
while i<10000
  i += 1
  fact(100)
end