Hi duro,

On Sun, Oct 17, 2010 at 1:02 AM, duro <[email protected]> wrote:
> So obvious! Thanks Minh for pointing it out to me.

No worries.


> In the meantime
> I've written a function that does the same but it was very inefficent.

You mean something like the following?

sage: b = "100110"
sage: sum(Integer(i) * (2^Integer(e)) for e, i in enumerate(b))
25
sage:
sage: sum(Integer(i) * (2^Integer(e)) for e, i in enumerate(b[::-1]))
38

-- 
Regards
Minh Van Nguyen

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to