Whats the equivalent of this without ixor ~
if(~(i3 + -1) < -1) { ... }
.
would it be this?
if((i3 + 1) > 0) { ... }
or (doubt this?)
if((i3 + 0) > 0) { ... }
or (doubt this?)
if(i3 < -1) { ... }
Thanks I cannot really test it out myself well I can.. but I’m writing a deobfuscator and I want to be 100% sure.
~xis the bitwise (not logical) inversion ofx. In two’s complement, it is equal to-1 - x. Try it.Now, to apply this to your condition:
Note, this only applies if the numbers are two’s complement — but almost all CPUs (and most programming languages) behave that way these days.