Answer the question
In order to leave comments, you need to log in
How to take the remainder of a division using bitwise operations?
How to take the remainder of a division using bitwise operations?
Answer the question
In order to leave comments, you need to log in
If the divisor is a power of two, then the remainder of the division can be obtained by bit and but subtract one from the divisor. For example 4565567 % 8 = 4565567 & 7
If the divisor is not a power of two, then bit operations will not help you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question