1

I have been playing around a little with trying to figure out a general rule for this but I suspect someone has already figured it out or at least there is some word for this kind of decomposition.

$x \mod (2^n+2^m) = F(x,n,m)?$

For example if n=3, m=1, can $x \mod 10$ be rewritten as F(x,n,m) using only bitwise-and/or operations and addition and subtraction (or multiply/divide by pow2)?

  • using Boolean algebra you can write addition as a series of bitor and bitand and bitneg. –  Nov 08 '19 at 20:16

0 Answers0