I'm getting two conflicting answers concerning the most significant bit:
The Math Doctor Says:
Check that against the decimal equivalent of 10110111 binary:
1 0 1 1 0 1 1 1
^ ^ ^ ^ ^ ^ ^ ^
| | | | | | | |_________> 1 x 2^0 = 1
| | | | | | |___________> 1 x 2^1 = 2
| | | | | |_____________> 1 x 2^2 = 4
| | | | |_______________> 0 x 2^3 = 8
| | | |_________________> 1 x 2^4 = 16
| | |___________________> 1 x 2^5 = 32
| |_____________________> 0 x 2^6 = 64
|_______________________> 1 x 2^7 = 128
183 decimal
However a JavaRanch user states:
the most significant byte being 1 or (2 ^ 7)=-128
therefore shouldnt the answer be = -73
I dont see the math doctor taking the most significant digit into accout. Whos right?
TIA
The Math Doctor Says:
Check that against the decimal equivalent of 10110111 binary:
1 0 1 1 0 1 1 1
^ ^ ^ ^ ^ ^ ^ ^
| | | | | | | |_________> 1 x 2^0 = 1
| | | | | | |___________> 1 x 2^1 = 2
| | | | | |_____________> 1 x 2^2 = 4
| | | | |_______________> 0 x 2^3 = 8
| | | |_________________> 1 x 2^4 = 16
| | |___________________> 1 x 2^5 = 32
| |_____________________> 0 x 2^6 = 64
|_______________________> 1 x 2^7 = 128
183 decimal
However a JavaRanch user states:
the most significant byte being 1 or (2 ^ 7)=-128
therefore shouldnt the answer be = -73
I dont see the math doctor taking the most significant digit into accout. Whos right?
TIA