lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Is there something about adding numbers that I should know about?

I'm using Lua 5.1.1

print(268435456)
268435456

print(268435456 + 1)
268435456

print(268435456 + 2)
268435456

I get the same results in hex (these numbers are part of a bit field)

print(0x10000000)
268435456

print(0x10000000 + 0x00000001)
268435456

print(0x10000000 + 0x00000002)
268435456

Brian