﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3680	Improve _ArrayBinarySearch function	anonymous	Melba23	"Think about the binary search not found case, return -1, then we _ArrayAdd and _ArraySort again.  But if the function can return a ""proper"" location through an additional byRef, we can now directly _ArrayInsert.  The binary search has to reach this position when it confirms it should return -1, therefore there should be no additional cost.  The return should keep unchanged to ensure back compatibility.

Additionally, when more than 1D involved, binary search on one column could have multiple match, a function which return the first and last match can be written reuse the binary search.  However, with additional edge argument (-1 for smallest index that match, 0 for which ever index match first, 1 for largest index that match) would make it convenient.  This could require a little more coding in the function. 

Overall, it should be convenient to use the c style sorting functions as argument for both sort and binary search.  Above requirement can be implemented by adjust sorting function when searching, at the cost of double the comparison times.

"	Feature Request	closed		Standard UDFs		None	Rejected		
