Author haypo
Recipients drj, haypo, mark.dickinson
Date 2008-11-04.23:17:57
SpamBayes Score 0.000625012
Marked as misclassified No
Message-id <1225840679.63.0.321401238701.issue3166@psf.upfronthosting.co.za>
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:59hayposetrecipients: + haypo, mark.dickinson, drj
2008-11-04 23:17:59hayposetmessageid: <1225840679.63.0.321401238701.issue3166@psf.upfronthosting.co.za>
2008-11-04 23:17:58haypolinkissue3166 messages
2008-11-04 23:17:57haypocreate