# Match tick count max value in Lua5.1?

**URL:** <https://forum.heroiclabs.com/t/match-tick-count-max-value-in-lua5-1/6074>\
**Category:** Runtime Framework\
**Tags:** server-framework\
**Created:** [March 10, 2025, 6:37am UTC](https://forum.heroiclabs.com/t/match-tick-count-max-value-in-lua5-1/6074 "2025-03-10T06:37:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yusuf](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/yusuf/32/1520_2.png) [@yusuf](https://forum.heroiclabs.com/u/yusuf)\
**Post date:** [March 10, 2025, 6:37am UTC](https://forum.heroiclabs.com/t/match-tick-count-max-value-in-lua5-1/6074/1 "2025-03-10T06:37:11Z")

</div>

Hello everyone. I have a question about the **tick** value of the match\_loop’s tick value.

```auto
match_loop(context, dispatcher, tick, state, messages)

```

If I check the Lua documentation, it is a number. In lua 5.1, according to chatGPT, the max value of a number is 2^53 − 1 = 9007199254740991. But in the Go documentation, it is a 64-bit integer, so the max value is 2^63 - 1 = 9223372036854775807.

To sum up, what should I expect as the max value? What is the situation with this problem?

I’m asking because I’m creating tick-count-based logic on the server side. If the maximum value is exceeded by default, it will automatically start from the minimum value. What should I expect after, if the value exceeds 2^53 − 1 = 9007199254740991 ???

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [March 11, 2025, 3:02pm UTC](https://forum.heroiclabs.com/t/match-tick-count-max-value-in-lua5-1/6074/2 "2025-03-11T15:02:05Z")

</div>

Hello @yusuf

10\_000 (years) \* 365 (days) \* 24 (hours) \* 60 (minutes) \* 60 (seconds) \* 60 (ticks/s) \< (2^53) − 1

Unless my math is off, even with the lower max value the tick in a long-running match with the highest allowed ticks/s of 60 wouldn’t rollover for at least 10\_000 years, so I don’t think that should be a concern 🙂 .

But if you’re using very big numbers from within the Lua VM, you should either experiment with a test or refer to [GitHub - yuin/gopher-lua: GopherLua: VM and compiler for Lua in Go](https://github.com/yuin/gopher-lua) to understand what the actual limit is.

I’d expect it to comply with the Lua 5.1 spec, but I am not certain myself.

Best.
