Can someone explain to me why .net computes them differently with Java
The equation
(-1646490243 << 4) + 3333 ^ -1646490243 + -957401312 ^ (-1646490243 >> 5) + 4
Java calculates it as
1173210151
.Net is calculated as
-574040108
My problem is that I need .Net to calculate the same thing as Java, since I pass through the decryption function, and if it calculates differently, then the decryption will not be correct.
Any help would be appreciated.
- Update -
Thanks guys, Hor was what I had to use. Plus you need to bypass Java without throwing an exception when the Integer number is too large.
Xor gives the result -3121757145
(-1646490243 << 4) + 3333 Xor -1646490243 + -957401312 Xor (-1646490243 >> 5) + 4
Combine this with the answer from this link I found - Java sum 2 negative numbers . Gets the same result as Java
-3121757145 + 2 ^ 32 = 1173210151
source share