[New-bugs-announce] [issue23007] Unnecessary big intermediate result in Lib/bisect.py
Sergey Litvinov
report at bugs.python.org
Sun Dec 7 23:43:11 CET 2014
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 one can run
into troubles with user defined types.
----------
components: Library (Lib)
messages: 232286
nosy: Sergey.Litvinov
priority: normal
severity: normal
status: open
title: Unnecessary big intermediate result in Lib/bisect.py
type: behavior
versions: Python 2.7, Python 3.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23007>
_______________________________________
More information about the New-bugs-announce
mailing list