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.0006250118
Marked as misclassified No
Message-id <[email protected]>
In-reply-to
Content
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
-65535

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