4 ms·
Full 64 bit would very likely need to be boxed (heap allocated). I assume bigint is not boxed up to 40-something bits and instead stored as NaN[0]. Once you sta
by mmoskal 4y ago
Full 64 bit would very likely need to be boxed (heap allocated). I assume bigint is not boxed up to 40-something bits and instead stored as NaN[0]. Once you start boxing, the additional few instructions to handle things above 64 bit are probably not that important, so they may as well be generic.
[0] https://anniecherkaev.com/the-secret-life-of-nan https://anniecherkaev.com/the-secret-life-of-nan
- AprilArcus 4y agoInteresting that there are 15*(2^47) unused values in this scheme in the range FFFF:xxx1:xxxx:xxxx - FFFF:xxxF:xxxx:xxxx. Could these be put to any practical use?
- ElectricalUnion 4y agohttps://github.com/philihp/nanbox https://github.com/philihp/nanbox You don't even need a Double, you can use a Float NaN to encode strings: > IEEE 754 encodes 32-bit floating points with 1 bit for the sign, 8 bits for the exponent, and 23 bits for the number part (mantissa). (...) > 23 bits isn't much space, but conveniently the max size of a Unicode codepoint is 0x10FFFF, making it a 22-bit charset. When you encode your strings in UTF-32, you're only going to be using 22 of those bits, so masking the top portion with the NaN signature makes all of your characters NaNs.