0

It's been over thirty years since my high-school algebra so pardon my ignorance due to senility. Is there a inverse to modulus in C language. Such that one could solve the reverse of a previous statement called.

Quite simply :

x = y % 128

How do I solve for y, using C code, if x is known.

Any help would be greatly appreciated.

Whales
  • 11
  • 1
  • 4
    I’m voting to close this question because this is fundamentally a math question, not a programming question. – Karl Knechtel Sep 05 '20 at 23:12
  • It's a semantic not logic question granted but a programming question none the less. – Whales Sep 05 '20 at 23:19
  • "Is there a inverse to modulus in C language." --> C lacks a proper modulus for `int`, let alone an inverse one. See [What's the difference between “mod” and “remainder”?](https://stackoverflow.com/q/13683563/2410359). – chux - Reinstate Monica Sep 06 '20 at 09:05
  • @Karl Knechtel I voting to re-open as there are important differences and limitations between the mathematical Modulus and C's remainder operator `%`. – chux - Reinstate Monica Sep 06 '20 at 09:09

1 Answers1

2

Mathematically, y can be solved in such format

x + 128*k

where k is any integer

ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81