```
class Solution(object):
def getSum(self, a, b):
"""
:type a: int
:type b: int
:rtype: int
"""
carry = 0
ans = 0
for i in range(32):
a1 = (a>>i) & 0x1
b1 = (b>>i) & 0x1
s = a1 ^ b1 ^ carry
ans |= (s << i)
carry = a1 & b1 | (a1 ^ b1) & carry
return ans if ans < pow(2,31) else ans - pow(2,32)
```