implement some integer operations with bitwise only