title: Detect If Two Integers Have Opposite Signs
signature: func detectIfTwoIntegersHaveOppositeSigns(x int, y int) bool {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual bool, expected bool) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(x int, y int, expected bool) string {
      if validateSolution(PLACEHOLDER_FN_NAME(x, y),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(59, 
  	-99, true)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(-20, 
  	-21, false)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(-100, 
  	79, true)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(54, 
  	-49, true)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(-16, 
  	16, true)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(-23, 
  	-68, false)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(93, 
  	37, false)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(24, 
  	-61, true)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(-8, 
  	69, true)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(29, 
  	10, false)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def detect_if_two_integers_have_opposite_signs(x, y):
      return ((x ^ y) < 0)
source_cpp: bool detect_if_two_integers_have_opposite_signs(int x, int y) {
    return ( ( x ^ y ) < 0 );
  }