[issue31031] Unify duplicate bits_in_digit and bit_length

2020-01-16 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bug

[issue31031] Unify duplicate bits_in_digit and bit_length

2020-01-16 Thread STINNER Victor
STINNER Victor added the comment: "On BSD, there's a library function called fls() that we could use, and GCC provides __builtin_clz()." See also rejected bpo-29782 and GH-594. If someone wants to experiment that, I suggest to add Include/internal/pycore_pymath.h, move _Py_bit_length() ther

[issue31031] Unify duplicate bits_in_digit and bit_length

2020-01-16 Thread STINNER Victor
STINNER Victor added the comment: Thanks Niklas Fiekas for merging duplicated code ;-) It should make factorial_partial_product() a little bit more efficient! -- ___ Python tracker _

[issue31031] Unify duplicate bits_in_digit and bit_length

2020-01-16 Thread STINNER Victor
STINNER Victor added the comment: New changeset c5b79003f5fe6aa28a2a028680367839ba8677db by Victor Stinner (Niklas Fiekas) in branch 'master': bpo-31031: Unify duplicate bits_in_digit and bit_length (GH-2866) https://github.com/python/cpython/commit/c5b79003f5fe6aa28a2a028680367839ba8677db

[issue31031] Unify duplicate bits_in_digit and bit_length

2017-07-25 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue31031] Unify duplicate bits_in_digit and bit_length

2017-07-25 Thread Niklas Fiekas
Changes by Niklas Fiekas : -- pull_requests: +2916 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue31031] Unify duplicate bits_in_digit and bit_length

2017-07-25 Thread Niklas Fiekas
New submission from Niklas Fiekas: My previous patch to optimize bits_in_digit was rejected: http://bugs.python.org/issue29782 This leaves this issue open (mathmodule.c): /* XXX: This routine does more or less the same thing as * bits_in_digit() in Objects/longobject.c. Someday it would be ni