[ create a new paste ] login | about

Link: http://codepad.org/pb8IuLnY    [ raw code | output | fork ]

Python, pasted on Dec 13:
1
2
3
4
5
6
7
8
9
10
11
12
def add(x, y):
    while True:
        a = x & y
        b = x ^ y
        x = a << 1
        y = b
        if a == 0:
            break
    return b

print("6 + 3 = %d" % add(6,3))
print("6 - 3 = %d" % add(6,-3))


Output:
1
Timeout


Create a new paste based on this one


Comments: