[issue23521] OverflowError from timedelta * float in datetime.py

Alexander Belopolsky report at bugs.python.org
Fri Feb 27 00:27:06 CET 2015


Alexander Belopolsky added the comment:

We can further optimize _divide_and_round by changing r*=2 to r<<=1 and q % 2 == 1 to (q & 1), but this will obfuscate the algorithm and limit arguments to ints.  (As written, _divide_and_round will work with any numeric types.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23521>
_______________________________________


More information about the Python-bugs-list mailing list