Why can the Bit Operators only function with 16 bits or less?
|
Sep 9 2014, 5:52 am
|
|
Because they're casted to unsigned short ints (uint16_t in the cstdint library) which are only 16 bits long.
|
To add to this, all numbers in BYOND are stored as single-precision floats. A single-precision float is 32 bits, but only uses 23 bits to store the significand (the other 9 bits store the sign and exponent). Because there's no built-in "23 bit unsigned integer" in C++ for BYOND to work with, they had to use an unsigned short, which only takes advantage of the lower 16 bits.
|