converting to bitwise arithmetic