title: Find number range intersection
body: <p>What is the best way to find out whether two number ranges intersect?</p>
  
  <p>My number range is <strong>3023-7430</strong>, now I want to test which of the following number ranges intersect with it: &lt;3000, 3000-6000, 6000-8000, 8000-10000, >10000. The answer should be <strong>3000-6000</strong> and <strong>6000-8000</strong>.</p>
  
  <p>What's the nice, efficient mathematical way to do this in any programming language?</p>