Binary search is harder to implement than it looks. "Although the basic idea of binary search is comparatively straightforward, the details can be surprisingly tricky…" — Donald Knuth.
Which bugs are most likely to be introduced into a new binary search implementation?
Here are some I can think of:
Are these what you have in mind?