Reverse Modulus Operator

前端 未结 6 709
情深已故
情深已故 2020-12-13 13:54

Over 3 years after asking the question I found the solution. I have included it as an answer.

I have an expression with modulus in it that needs to

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 14:29

    The tricky part about this equation is that even if you know a, m, and b, you can not conclusively figure out x.

    For example, say your equation was:

    (2 + x) % 4 = 3
    

    x could be 1, 5, 9, 13 etc.

    This means you are out of luck, there is no way to get x by itself.

提交回复
热议问题