Fix for JRUBY-2882. Handle error messages related to constructors better
[jruby.git] / bench / shootout / harmonic.ruby-2.ruby
blob97f7b06ad72e276779c3602fddc5355efcf839f0
1 #!/usr/bin/ruby
2 # http://shootout.alioth.debian.org/
4 # Contributed by Christopher Williams
5 # modified by Daniel South
6 # modified by Doug King
8 n = (ARGV[0] || 10000000).to_i
10 partialSum = 0.0
11 for i in (1..n)
12 partialSum += (1.0 / i)
13 end
15 printf("%.9f\n", partialSum)