Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add(x,y):
- while y>0:
- x,y = x^y,(x&y)<<1
- return x
- def mult(x,y):
- total = 0
- while y>0:
- if y&1 == 1:
- total = add(total,x)
- x = x<<1
- y = y>>1
- return total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement