Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/Integer-overflow/Lua/integer-overflow.lua
Normal file
5
Task/Integer-overflow/Lua/integer-overflow.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
assert(math.type~=nil, "Lua 5.3+ required for this test.")
|
||||
minint, maxint = math.mininteger, math.maxinteger
|
||||
print("min, max int64 = " .. minint .. ", " .. maxint)
|
||||
print("min-1 underflow = " .. (minint-1) .. " equals max? " .. tostring(minint-1==maxint))
|
||||
print("max+1 overflow = " .. (maxint+1) .. " equals min? " .. tostring(maxint+1==minint))
|
||||
Loading…
Add table
Add a link
Reference in a new issue