3 ms·
> Could we have a solution which would keep ints unboxed but have fast arithmetic operations? Wait, is the answer not floating point? Using 64-bit IEEE 754 me
by arh68 12y ago
> Could we have a solution which would keep ints unboxed but have fast arithmetic operations?
Wait, is the answer not floating point? Using 64-bit IEEE 754 means the lower 52 bits (51-0) are significand, and bit 52 is implicitly 1, so setting bit 0 to keep track of GC stuff only introduces an error of ~1/2^52.
Floating-point multiplication isn't as fast as integer ALUs, perhaps, and you're now limited to 52-bit integers, but that's what Lua does and it gets by fine.