Bitwise AND (&) between negative and positive numbers?
问题 I've been learning about adding two numbers using bit manipulation and I am having issues understanding how it is done in Python for negative numbers. For example, if I am trying to & the following: -0b1111010 (-122) & 0b11011110 (222) shouldn't it be: 0b1111010 & 0b11011110 ------------ 0b01011010 since only a combination of 1's results in 1's? Right now python gives 0b10000110 I couldn't find any resources specifically when a negative number is added to a positive number using python. 回答1: