Comment on Why is division so much more complex than other arithmetic operations?parentComments−IshKebab3yHe is talking about the fact that compilers can turn division by a constant into multiplications and bit shifts which are much faster.Here's an example: https://godbolt.org/z/8vG637fb5It compiles x/6 to some mad multiplication, bitshift and add.
Comments
He is talking about the fact that compilers can turn division by a constant into multiplications and bit shifts which are much faster.
Here's an example: https://godbolt.org/z/8vG637fb5
It compiles x/6 to some mad multiplication, bitshift and add.