3 ms·
Having written an int62_t class in C++ last year, I now feel I should return to it and verify that the bitshift version I wrote is faster than this. I mean, it'
by PaulDavisThe1st 5y ago
Having written an int62_t class in C++ last year, I now feel I should return to it and verify that the bitshift version I wrote is faster than this. I mean, it's written in Rust, which apparently is the new hotness, so I should really make sure, right?
I agree with the comments that point out that not knowing about shift operators isn't really that surprising, but believing you have a reason to want 42 bits of a 64 bit value without knowing about shift operators is.
- CRConrad 5y ago> I agree with the comments that point out that not knowing about shift operators isn't really that surprising, but believing you have a reason to want 42 bits of a 64 bit value without knowing about shift operators is. Come to think of it, the article doesn't say why they wanted to do that in the first place. At least one comment mentions having stuff (booleans) encoded in bits and extracting those that go together, and of course that could be it, but we don't know. My own first thought, on seeing the variable name "snowflake", was something along the lines of "What, does the Snowflake database store integers as 42-bit values or something?"