Sign detection using bitwise operators