alexander pantyukhin date november 30 2022 task given two int numbers return true these numbers have opposite signs or false otherwise implementation notes use bit manipulation use xor for two numbers return true if numbers have opposite signs false otherwise differentsigns1 1 true differentsigns1 1 false differentsigns1000000000000000000000000000 1000000000000000000000000000 true differentsigns1000000000000000000000000000 1000000000000000000000000000 true differentsigns50 278 false differentsigns0 2 false differentsigns2 0 false return true if numbers have opposite signs false otherwise different_signs 1 1 true different_signs 1 1 false different_signs 1000000000000000000000000000 1000000000000000000000000000 true different_signs 1000000000000000000000000000 1000000000000000000000000000 true different_signs 50 278 false different_signs 0 2 false different_signs 2 0 false
def different_signs(num1: int, num2: int) -> bool:
    
    return num1 ^ num2 < 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()