Answer the question
In order to leave comments, you need to log in
How to transform an equation with mod()?
r = x*k % 32;
How to transform this equation to find x?
Answer the question
In order to leave comments, you need to log in
r = (k * x) % 32
k * x = 32 * i + r, i ∈ ℤ ≥0
x = (32 * i + r) / k, i ∈
ℤ ≥0
for the mod operation with negative numbers.
It will not be possible to transform this equation, because there is no inverse operation for mod, because there will be a set of x values.
You can find them like this:
for (int x, x<1000, x++)
{
if r==(x*k)%32 then cout << x << ', ';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question