mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-22 07:20:05 +00:00
CPunch
9aa7fa1381
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
12 lines
218 B
Lua
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
|