On Oct 18, 7:06 am, Ixiaus <[EMAIL PROTECTED]> wrote:
[...]
> I know '<<' is shifting x over by n bits; but could you point me to
> some literature that would explain why it is the same as "x*2**n"?

I haven't got literature but I've got a (hopefully straightforward)
explanation:

In binary 2 is 10.  When you multiply by 10, you shift all your digits
left by 1 place.
When you multiply by 10**n (which is 1 followed by n zeroes), you
shift all your digits left by n places.

HTH

--
Arnaud


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to