Author belopolsky
Recipients
Date 2007-04-19.21:51:13
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Python 2.5 (r25:51908, Nov 24 2006, 11:03:50)
[GCC 3.4.4 20050721 (Red Hat 3.4.4-2)] on linux2
>>> from ctypes import *
>>> c_int(2**31).value
-2147483648
>>> c_long(2**32-1).value
-1

In a 64-bit build, the situation is even worse:

>>> c_int(int(2**32)).value
0
>>> c_int(2**32).value
0

Another way to see the problem:
>>> c = CDLL(None)
>>> c.printf("%d\n", 2**32)
0
2
History
Date User Action Args
2007-08-23 14:53:13adminlinkissue1703952 messages
2007-08-23 14:53:13admincreate