Comment

Comment by free_bip

Remainder after division is one. E.g. 12 mod 4 = 0. There's no way to reverse that operation given only the output and the modulus. (x mod 4 = 0 has infinite solutions)

Bitwise operators are another. A & B, A | B, A << B, A >> B are all in general not invertible given the output and B. (e.g. A | 1 = 1, is A 0 or 1?)

Now I haven't looked at the language in detail, maybe there's a way around this, but it sounds like if truly every single operation is invertible, then there would be no way to calculate these simple functions.

parent free_bip 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton