/*****************************************************************************/ /* */ /* UNIT: NTL0_overlaps (Level 0 library routine) */ /* */ /* Author: Nikola Stojanovic */ /* */ /* Revision: 27 JUN 94 Version 1.0 */ /* */ /* Function: */ /* */ /* Procedure checks whether two provided intervals overlap or not; returns */ /* 1 if they do, 0 if not */ /* */ /*****************************************************************************/ #include "ntl0.h" /*****************************************************************************/ int NTL0_overlaps (long int low1, long int high1, long int low2, long int high2) { if ((low1 <= low2) && (high1 >= low2)) return 1; else if ((low1 <= high2) && (high1 >= high2)) return 1; else if ((low1 >= low2) && (high1 <= high2)) return 1; else return 0; }