Re: Type Conversions for unsigned integers
"Mark Tolonen" <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
"Nikolaus Rath" <[email protected]> wrote in message news:[email protected]... > Hello, > > Why does the c_uint8 type behave so different from the others? > >>>> c_uint8(-1).value > -1 >>>> c_uint16(-1).value > 65535 >>>> c_uint32(-1).value > 4294967295L >>>> c_uint(-1).value > 4294967295L Because you need to upgrade? Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> c_uint8(-1).value 255 What version of Python are you using (and ctypes, if it wasn't bundled)? -Mark ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev