ID:1877427
 
(See the best response by Lummox JR.)
At what exact number on BYOND do I lose accuracy? i.e What is the max number that is acting purely as an integer?

I would like to work on a type of hash table and I'm trying to work out where the absolute maximum is for an addressing number. Considering I need 100% accurate addressing.
Best response
It's 2**24.

BYOND uses single-precision (32-bit) floating point, which means it has a 23-bit mantissa. Except in the case of 0, an assumed 1 is followed by a decimal point (actually, a binary point) followed by those 23 bits. Thus, you can have 24 bits of number for a range of -(2**24-1) to (2**24-1). But 2**24 is easily represented in floating point also since it's a single 1 bit, so the actual integer range is -2**24 to 2**24.
In response to Lummox JR
Lummox JR wrote:
It's 2**24.

BYOND uses single-precision (32-bit) floating point, which means it has a 23-bit mantissa. Except in the case of 0, an assumed 1 is followed by a decimal point (actually, a binary point) followed by those 23 bits. Thus, you can have 24 bits of number for a range of -(2**24-1) to (2**24-1). But 2**24 is easily represented in floating point also since it's a single 1 bit, so the actual integer range is -2**24 to 2**24.

Thank you very much :)