diff options
author | Igor <pashev.igor@gmail.com> | 2011-02-21 11:50:29 +0300 |
---|---|---|
committer | Igor <pashev.igor@gmail.com> | 2011-02-21 11:50:29 +0300 |
commit | fa27781d02045206442d76f380a23568d3a13336 (patch) | |
tree | 6a18b40a8208b9116d8ddc9801d101deba001d80 | |
parent | 06e6300c6e0f16df5764b886089a92ca42a7868e (diff) | |
download | gcd-fa27781d02045206442d76f380a23568d3a13336.tar.gz |
local r; table.maxn -> #
-rwxr-xr-x | gcd.lua | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -14,8 +14,8 @@ function gcd2(a, b) end function gcdn(ns) - r = ns[1] - for i = 2, table.maxn(ns) do + local r = ns[1] + for i = 2, #ns do r = gcd2(r, ns[i]) end return r |