Limit on how many values you can store in tables?

Recently I came across a question that I couldn’t answer myself, and nor could anyone else in the discord server I’m in.

local numTable = {1,4,2,1,5,6,2,6,1,2,6,7,1,5,6,1,2,5,6,1,7,7,8,2,3,6}

local function maxNum(...)

return print(math.max(...))

end

maxNum(table.unpack(numTable))

Is there a limit to how many values I can put inside “numTable”? I was recently told it depends on the ‘devices ram’, but I’m not exactly sure how that would work or play part in this.

5 Likes

There probably is, but it’s probably so high that you won’t ever have to worry about it.

I just did a 30-second search and the max on most languages is around 2E1024 so you will really not have to worry about it. Of course, it depends on the system but it’s still really massive.

4 Likes

Thanks, clears it up for me so I don’t have to worry about any unnecessary limits.

1 Like