There are couple of issues in the function:
- >>> operator would mess the values if low + high end up being negative. This shouldn't happen but I don't see anything to prevent this from happening.
- The code fails around boundary values of low and high. This is a well known binary search catch. https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html
Most of the code should already be covered by tests. I would have liked to add a test that actually fails without the fix but given these are private methods I am not sure on the best place to add the test. Suggestions?