Sergey Litvinov added the comment:
mark.dickinson> do you have an example of the Lib/bisect.py code
No. I was thinking about something hypothetical similar to the one you
provided.
rhettinger> The "textbook" formula is more important in languages
rhettinger> without somethi
New submission from Sergey Litvinov:
Bisection algorithms use
mid = (lo+hi)//2
Textbook formula is
mid = (hi-lo)//2 + lo
See
http://en.wikipedia.org/w/index.php?title=Binary_search_algorithm&oldid=634658510#Arithmetic
For "vanilla" lists and integers it is not a problem but on