[Tutor] bin to dec conversion puzzlement
Jim Mooney
cybervigilante at gmail.com
Mon Apr 20 22:15:09 CEST 2015
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
More information about the Tutor
mailing list