Binary search with signed bounds

Code reviewHard18 min

Your task

Review this C++ binary search over an index range that can include negative coordinates (e.g. a signed axis).

It is called with lo as low as INT_MIN and hi near INT_MAX.