5 ms·
His article about bit manipulation is very nice, as well. https://catonmat.net/low-level-bit-hacks https://catonmat.net/low-level-bit-hacks
by siegelzero 6y ago
His article about bit manipulation is very nice, as well.
https://catonmat.net/low-level-bit-hacks https://catonmat.net/low-level-bit-hacks
- pkaye 6y agoHackers Delight is a pretty fun book on low level algorithms. Lots of little tidbits like how to convert a divide by a constant into a multiple by a different constants and a shift. Thought these days the compilers are good enough to do the same thing but now when you look at the resulting assembly you can figure out how they are doing that.
- smabie 6y agoEven if compilers are usually good enough, people (mostly in the market making/HFT space) are still doing this kind of stuff. For example, division (and to a lesser extent, multiplication) is still avoided/hacked around in the fast path for these kinds of strategies.
- tyingq 6y agoThat's a good call-out. It's natural for me, but I do see people struggle with bit manipulation regularly. A comprehensive, yet plain language intro, with simple examples, is really useful. You can tell this was developed after extensive interactions with undergrads. It's really well done.
- mehrdadn 6y agoSee https://graphics.stanford.edu/~seander/bithacks.html https://graphics.stanford.edu/~seander/bithacks.html