The key is that the result gets multiplied by 2 each time

> so for an N bit number the leftmost digit winds up being
> effectively 2**N, which is what you want.
>


> Alan G


Ah, the light dawns once it was restated. It would be even simpler if you
could multiply each element of the binary number by it's respective power
of two, and sum them all at once. I hear Py 3.5 will have vector abilities.
I wonder it if would do something like that.

Jim
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to