So I just need to Convert two's complement to sign-magnitude using bit manipulation.
I was able to fix the problem but it's quite long, I wonder if you guys have a way or can shorten what I did
(~x >> 31 & x) | (((x & 0x80000000) - x) & x>>31);
User contributions licensed under CC BY-SA 3.0