Message75510
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 |
|
Date |
User |
Action |
Args |
2008-11-04 23:17:59 | vstinner | set | recipients:
+ vstinner, mark.dickinson, drj |
2008-11-04 23:17:59 | vstinner | set | messageid: <1225840679.63.0.321401238701.issue3166@psf.upfronthosting.co.za> |
2008-11-04 23:17:58 | vstinner | link | issue3166 messages |
2008-11-04 23:17:57 | vstinner | create | |
|