Help: C char bits operations to python converting

Fredrik Lundh effbot at telia.com
Wed Sep 27 16:05:47 EDT 2000


Joshua wrote:
> def SignExtend(char):
>     if char & 0x80:
>         char = char ^ 0xffffff00
>     return char
> 
> yes?

no.  don't assume that all platforms use 32-bit integers.

</F>




More information about the Python-list mailing list