ult()
Published Oct 15, 2023
Contribute to Docs
The ult()
method takes two integers as arguments and compares their absolute values. The method will return true
if and only if the first value is less than the second value. Otherwise, it will return false
.
Syntax
The syntax of ult()
is as follows:
math.ult(int1, int2)
Where int1
and int2
are the integer arguments to be compared.
Examples
The following examples illustrate the behavior of ult()
:
print(math.ult(5,6))print(math.ult(5,-6)) --lua will convert '-6' to the unsigned integer '6' when performing this callprint(math.ult(5,5))print(math.ult(5,4))
This results in the output:
truetruefalsefalse
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.