public static bool ContainsMinor(long[] array, int size, int value) { int low = 0; int high = size - 1; while (low <= high) { int midIdx = low + (high - low) / 2; int minorVal = Miscellanea.Low(array[midIdx]); if (minorVal < value) { // midIdx is below the target range low = midIdx + 1; } else if (minorVal > value) { // midIdx is above the target range high = midIdx - 1; } else { return(true); } } return(false); }
////////////////////////////////////////////////////////////////////////////// private static void Flip(long[] array, int size) { for (int i = 0; i < size; i++) { long entry = array[i]; array[i] = Miscellanea.Pack(Miscellanea.High(entry), Miscellanea.Low(entry)); } }
private static int Index(long entry) { return(Miscellanea.Low(entry)); }
static internal int Arg2(long tuple) { return(Miscellanea.Low(tuple)); }