A
A
Adik Izat2018-09-19 01:36:52
Mathematics
Adik Izat, 2018-09-19 01:36:52

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

3 answer(s)
R
Rsa97, 2018-09-19
@JaxAdam

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.

T
Tabris17, 2018-09-19
@Tabris17

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 << ', ';
 }

A
AVKor, 2018-09-19
@AVKor

No way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question