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 serhiy.storchaka
Recipients Oren Milman, mark.dickinson, serhiy.storchaka
Date 2016-06-14.19:33:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465932788.54.0.141409046865.issue27298@psf.upfronthosting.co.za>
In-reply-to
Content
The accurate number of digits is (sizeof(x) * 8 + PyLong_SHIFT - 1) / PyLong_SHIFT or (sizeof(x) * 8 - 1) / PyLong_SHIFT + 1.

There is a similar code in _PyLong_AsUnsignedLongLongMask().

Changes of Modules/_testcapimodule.c look not related to the implementation of _PyLong_AsUnsignedLongMask.

Needed some results of microbenchmarking. The patch speeds up _PyLong_AsUnsignedLongLongMask() for very large integers, but in most cases this function is called for not such larger integers, and the patch adds additional check. We should ensure that this doesn't slow down the function.
History
Date User Action Args
2016-06-14 19:33:08serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson, Oren Milman
2016-06-14 19:33:08serhiy.storchakasetmessageid: <1465932788.54.0.141409046865.issue27298@psf.upfronthosting.co.za>
2016-06-14 19:33:08serhiy.storchakalinkissue27298 messages
2016-06-14 19:33:08serhiy.storchakacreate