blob: f879eeebc8fcca52407f1dc9c8a92760b9967a35 [file] [log] [blame]
-- The Great Computer Language Shootout
-- http://shootout.alioth.debian.org/
--
-- contributed by Isaac Gouy
local n = tonumber(arg and arg[1]) or 10000000
local partialSum = 0.0
for d = 1,n do partialSum = partialSum + (1.0/d) end
io.write(string.format("%0.9f",partialSum), "\n")