Is there any difference between signed and unsigned variables on bitwise operations?
For example,when dealing with unsigned numbers:
AND 00000111, 00001101
will result 00000101.
But what would happen when dealing with signed numbers?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming 2’s complement is used for signed numbers, operations that care about signedness (ie they are different for the signed and unsigned interpretation of a bitstring) are:
Operations for which signedness is irrelevant are:
-xmeans~x + 1)~xmeans-x - 1)