Determining if two ranges overlap

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Marky (Marky.11s2b3_at_excelforum-nospam.com)
Date: 02/17/04


Date: Tue, 17 Feb 2004 09:48:41 -0600

Hi,

I am trying to write a piece of code that will enable me to validate
two ranges to determine whether or not they overlap. I can determine
fairly easily if one is contained wholly within the other but not if
they only partially overlap. Any suggestions on how I could approach
this problem would be appreciated!

Thanks,
Mark

---
Message posted from http://www.ExcelForum.com/


Relevant Pages

  • Re: foreach enhancement
    ... incumbent on the programmer to overload the operators if they wanted ... person defines the problem as simple x..y ranges, ... If we are looking at as a list, which may contain multiple ranges, ... single range with no overlap in some situations (i.e., ...
    (microsoft.public.dotnet.languages.csharp)
  • [PATCH] dma-debug: Fix the overlap() function to be correct and readable
    ... static inline int overlap(void *addr, unsigned long len, void *start, void *end) ... Subject: dma-debug: Fix the overlap() function to be correct and readable ... because if we get totally bad DMA ranges passed far more things ...
    (Linux-Kernel)
  • Re: [PATCH] dma-debug: Fix the overlap() function to be correct and readable
    ... Subject: dma-debug: Fix the overlap() function to be correct and readable ... Linus noticed how unclean and buggy the overlapfunction is: ... suggestions minus the paranoid checks (we cannot overflow really ... because if we get totally bad DMA ranges passed far more things ...
    (Linux-Kernel)
  • Re: Determing whether two ranges overlap
    ... whether the ranges overlap each other. ... """Given two numeric ranges, returns a flag True or False ... Assuming you need fastest performance, the general method to do that is to ... you can gain a little speed by making a local reference to the function: ...
    (comp.lang.python)
  • Re: [PATCH] dma-debug: Fix the overlap() function to be correct and readable
    ... Subject: dma-debug: Fix the overlap() function to be correct and readable ... Linus noticed how unclean and buggy the overlapfunction is: ... suggestions minus the paranoid checks (we cannot overflow really ... because if we get totally bad DMA ranges passed far more things ...
    (Linux-Kernel)