3 ms·
> > Well, doubles can represent all the numbers a 52 bit int can, so there's not a huge reason to not use doubles for whole numbers. > Not exactly. Yes, exact
by samatman 8y ago
> > Well, doubles can represent all the numbers a 52 bit int can, so there's not a huge reason to not use doubles for whole numbers.
> Not exactly.
Yes, exactly [0]. The 52 bit significand gives LuaJIT and other NaN-tagged languages exact integer representations within that range.
[0]: https://en.wikipedia.org/wiki/Floating-point_arithmetic#Internal_representation https://en.wikipedia.org/wiki/Floating-point_arithmetic#Inte...