Bit Hacks and Arithmetic - Algorithmica
Bit Hacks and Arithmetic

Bit Hacks and Arithmetic

As we have seen in the previous chapter, knowing darker corners of the instruction set can be very fruitful, especially in the case of CISC platforms like x86, which currently has somewhere between 1000 and 4000 distinct instructions, depending on how you count.

In this chapter, we will discuss number representations and their use in numerical algorithms, as well as some core mathematical concepts in algebra and number theory that are often overlooked in computer science curricula.