This sounds like the binary search which is implemented in `sort.jl` under the name of `searchsortedfirst` (which was not what I needed, thus I wrote my own).  Also, note that you should probably use `>>>`, see http://googleresearch.blogspot.co.uk/2006/06/extra-extra-read-all-about-it-nearly.html