I recently stumbled across a feature of Lua of which I was unaware, as it is not mentioned in the hard-copy Programming In Lua manual.
Lua these days allows you to use hex constants (similar to C) by prefixing them by 0x.
For example:
This can be very useful where you happen to know the hex code and don't want to reach for your calculator to convert it back to decimal.
Lua these days allows you to use hex constants (similar to C) by prefixing them by 0x.
For example:
print (0xFF) --> 255
print (0xFFFF) --> 65535
This can be very useful where you happen to know the hex code and don't want to reach for your calculator to convert it back to decimal.