Dekkonot/bitbuffer

Throw when handling greater than 52-bit integers

Closed this issue · 2 comments

All Lua numbers are doubles, which are only accurate to 52 bits. Writing or reading an integer greater than that (either signed or unsigned) should error.

If we're going to do this, we may as well do it properly and have it throw. It's a footgun to use integers greater than 2^53 in Lua anyway.

On second thought, this feels unfriendly. If someone is using writeUnsigned/writeSigned, they know what they're getting into.