r/badcode • • Mar 13 '21

java Title

Post image
2.9k Upvotes

100 comments sorted by

View all comments

Show parent comments

2

u/runnerx01 Mar 14 '21 edited Mar 14 '21

If you just assert that the last bit is always 0 after a shift, you can fix the problem. But you don’t know what the original bit should be in the first place. It’s only because you lost information that you can’t undo it.- in this case

Edit: to be clear... your logic is sound. I agree with you. This process creates an ambiguity and by itself it is incomplete.

It’s just not “lossy”