bit shifting question

Michael Hudson mwh at python.net
Tue May 18 07:12:05 EDT 2004


Grant Edwards <grante at visi.com> writes:

> On 2004-05-17, Michael Hudson <mwh at python.net> wrote:
> 
> >> My question is does python share java's peculiar mode of bit
> >> shifting, or does python adhere closer to c's bit shifting?
> >
> > The right shift in Python is arithmetic, i.e. preserves the
> > sign bit.
> 
> Which one is the sign bit?  IOW, how wide is a "word"?

Well, quite :-)  Perhaps I should have said "preserves sign".

Cheers,
mwh

-- 
  I'm sorry, was my bias showing again? :-)
                                      -- William Tanksley, 13 May 2000



More information about the Python-list mailing list