I'm trying to get the following result 00000000000000101 from this input 5.
This my code and it doesn't make sense:
public static int get16Bits(int x)
{
System.out.println((x & 0xffff) - ((x & 0x8000) << 1));
return (x & 0xffff) - ((x & 0x8000) << 1);
}
How i can get the 16bits of integer value?