Help: C char bits operations to python converting

Joshua Muskovitz josh at open.com
Wed Sep 27 16:42:54 EDT 2000


ok, char = char | ~(0xff) ?

"Fredrik Lundh" <effbot at telia.com> wrote in message
news:vqsA5.1012$jk1.73355 at newsc.telia.net...
> 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>
>




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list