Message128143
| Author |
arigo |
| Recipients |
arigo |
| Date |
2011年02月07日.17:45:54 |
| SpamBayes Score |
2.6571584e-08 |
| Marked as misclassified |
No |
| Message-id |
<1297100755.38.0.104149239471.issue11144@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
On 32 bits, there is no reason to get a 'long' here:
>>> int(float(sys.maxint))
2147483647L
>>> int(int(float(sys.maxint)))
2147483647
>>> int(float(-sys.maxint-1))
-2147483648L
>>> int(int(float(-sys.maxint-1)))
-2147483648
On 64 bits, it's another story because floats cannot store 64 bits of precision. However, -sys.maxint-1 can still be represented exactly in a float, and the same issue occurs:
>>> int(float(-sys.maxint-1))
-9223372036854775808L
>>> int(int(float(-sys.maxint-1)))
-9223372036854775808 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年02月07日 17:45:55 | arigo | set | recipients:
+ arigo |
| 2011年02月07日 17:45:55 | arigo | set | messageid: <1297100755.38.0.104149239471.issue11144@psf.upfronthosting.co.za> |
| 2011年02月07日 17:45:54 | arigo | link | issue11144 messages |
| 2011年02月07日 17:45:54 | arigo | create |
|