Cosmo/examples/fibtest.lua
CPunch 9aa7fa1381 replaced facttest.lua with fibtest.lua
Optimized the NaN box to be byte aligned, performance under the fibtest.lua script improved by ~2.5 seconds (~31 before ~28.5 after on cpunch's machine)
also cleaned up some misc. comments
2020-12-07 23:26:55 -06:00

12 lines
218 B
Lua

local function fib(num)
if num <= 1 then
return num
else
return fib(num-2) + fib(num-1)
end
end
for (var i = 1; i < 40; i++) do
print("The fib number of " .. i .. " is " .. fib(i))
end