Compute modulus division by a power of 2 number – Bit Algorithm – operators, where d is a power of 2 number.Let it bit from right is set in d. For getting n
mod math
3 Articles
3
Optimization Techniques | Set 1 (Modulus) – Bit Algorithm – The modulus operator (%) in various languages is costly operation. Ultimately every operator. must result in processor instructions. Some processors won’t have modulus instruction at hardware level
Add two numbers without using arithmetic operators – Bit Algorithm – Sum of two bits can be obtained by performing XOR (^) of the two bits.