Convert from two's complement to sign-magnitude

0

So I manage to figure out most of bits.c questions,

however I am struggling with this one and everything I turn out to be false.

/*
 * twosComp2SignMag - Convert from two's complement to sign-magnitude
 *   where the MSB is the sign bit
 *   You can assume that x > TMin
 *   Example: twosComp2SignMag(-5) = 0x80000005.
 *   Legal ops: ! ~ & ^ | + << >>
 *   Max ops: 15
 *   Rating: 4
 */
int twosComp2SignMag(int x) {
  return 2;
}
java
bit
signed
twos-complement
asked on Stack Overflow Feb 2, 2019 by (unknown user)

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0