compare range of numbers to check intersections of ranges