Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- A=$1
- B=$2
- while [ $B -gt 0 ]; do
- CARRY=$((A & B))
- A=$((A ^ B))
- B=$((CARRY << 1))
- done
- echo $1"+"$2"="$A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement