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 vstinner
Recipients drj, mark.dickinson, vstinner
Date 2008-11-04.23:17:57
SpamBayes Score 0.000625012
Marked as misclassified No
Message-id <>
You may use "if (nbits == (size_t)-1 && PyErr_Occurred())" to check 
_PyLong_NumBits() error (overflow). Well, "if (numbits > DBL_MAX_EXP)" 
should already catch overflow, but I prefer explicit test to check the 
error case.

Anyway, interresting patch! Python3 vanilla:
>>> n = 295147905179352891391; int(float(n)) - n

Python3 + your patch:
>>> int(float(n)) - n
Date User Action Args
2008-11-04 23:17:59vstinnersetrecipients: + vstinner, mark.dickinson, drj
2008-11-04 23:17:59vstinnersetmessageid: <>
2008-11-04 23:17:58vstinnerlinkissue3166 messages
2008-11-04 23:17:57vstinnercreate