mininteger
Published Oct 23, 2023
Contribute to Docs
math.mininteger
is a constant that is part of Lua’s math
library. The math.mininteger
constant is a constant representing the smallest value that can be possibly held by an integer.
Note: The
math.mininteger
constant has the opposing functionality to themath.maxinteger
constant which returns the highest value that can be held by an integer.
Syntax
Since mininteger
is a constant from Lua’s library math
, it is called as math.mininteger
.
math.mininteger
Example
To find the smallest possible integer value in Lua:
print(math.mininteger)
This results in something like the following output:
-9223372036854775808
It can be used when assigning a variable to a very small value:
local max = math.minintegerif someValue > max thenmax = someValue
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Lua on Codecademy
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Free course
Learn Lua
Learn the basics of Lua, a general-purpose programming language used for building games, web apps, and developer tools.Beginner Friendly4 hours