This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sergey.Litvinov
Recipients Sergey.Litvinov
Date 2014-12-07.22:43:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417992191.21.0.852637765732.issue23007@psf.upfronthosting.co.za>
In-reply-to
Content
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 one can run
into troubles with user defined types.
History
Date User Action Args
2014-12-07 22:43:11Sergey.Litvinovsetrecipients: + Sergey.Litvinov
2014-12-07 22:43:11Sergey.Litvinovsetmessageid: <1417992191.21.0.852637765732.issue23007@psf.upfronthosting.co.za>
2014-12-07 22:43:11Sergey.Litvinovlinkissue23007 messages
2014-12-07 22:43:11Sergey.Litvinovcreate