[Tutor] << operator ? [left bitwise shifting]

Prahlad Vaidyanathan slime@vsnl.net
Fri, 12 Apr 2002 04:29:25 -0400


Hi,

Thanks to all for their explanations. But, let me prod a little further
(OT) ...

On Wed, 10 Apr 2002 Danny Yoo spewed into the ether:
[-- snippity --]
> And this is what we mean when we say that computers count in base-two
> arithmetic --- they represent numbers by using on/off switches --- "bits".
> On most systems that Python runs on, each integer is made up of 32 bits.

Hmm .. is this the difference between the computers used popularly
today, and the new IA-64 architecture ? If so, does a "2" on a 64-bit
machine have 32 more zeroes in front of it, than a "2" on a 32-bit
machine ?

> It turns out that bits are really useful because we don't have to say that
> 32 bits always stand for a number: we can use those bits as 32 individual
> "yes/no" choices!

Ahh .. now I remember the Boolean Algebra we did in school. Ok, that
clears it up nicely :-)

> Here's a concrete example: the Unix operating system uses numeric codes to
> say if a particular file is readable, writable, or executable --- each
> file has a "permission" number connected to it.  The number "7", for
> example, has the following bit representation:
[-- snippity --]

Ok. I think I've got a hang of what these operators do. Now to go find
a binary file to play with in "pure" python .... :-)

pv.
-- 
Prahlad Vaidyanathan  <http://www.symonds.net/~prahladv/>

The appreciation of the average visual graphisticator alone is worth
the whole suaveness and decadence which abounds!!