Convert two's complement to sign magnitude using bit manipulation

0

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);
c
bit-manipulation
bit
asked on Stack Overflow Feb 7, 2019 by (unknown user)

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0