maxinteger

Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
Published Oct 18, 2023
Contribute to Docs

In Lua, the math.maxinteger is a constant that is part of the Lua math library. The math.maxinteger constant is used to return the largest possible integer value.

Note: The math.maxinteger constant is only available in Lua 5.3 and above. For earlier versions of Lua, the math.huge constant is available instead.

Syntax

As maxinteger is a part of the standard Lua math library, it must be called as math.maxinteger.

math.maxinteger

Example

To find the largest possible integer value in Lua:

print(math.maxinteger)

This results in something like the following output:

9007199254740991

All contributors

Looking to contribute?

Learn Lua on Codecademy