summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Bard <github@adambard.com>2013-07-29 00:06:57 -0700
committerAdam Bard <github@adambard.com>2013-07-29 00:06:57 -0700
commitd2b5b51b9c6df3aba68ade517746032db9e39a88 (patch)
tree5bba70ae10ef26fcbd074a7544255a0d4f47364e
parente0f30cc8d26c8b6d1166c67b885000c610105b6e (diff)
parent7938abfe88aa985320776bbd9a428a581dadc621 (diff)
Merge pull request #139 from amrnt/master
fix fib function for Lua: fib(0) must eql 0 not 1
-rw-r--r--lua.html.markdown2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua.html.markdown b/lua.html.markdown
index 0ece399f..7325a1cf 100644
--- a/lua.html.markdown
+++ b/lua.html.markdown
@@ -87,7 +87,7 @@ until num == 0
----------------------------------------------------
function fib(n)
- if n < 2 then return 1 end
+ if n < 2 then return n end
return fib(n - 2) + fib(n - 1)
end