STINNER Victor added the comment: As noticed by veky on the review, _high_bit() is slow and can be optimized using int.bit_length(). Attached bit_length.patch implements this.
_high_bit(0) returns -1. Maybe an exception must be raised if the argument is < 1? (also fail for negative number) ---------- Added file: http://bugs.python.org/file44319/bit_length.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23591> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com