The main idea was the same, but I've implemented it in a different
manner ;)

Regards,
duro

On 16 Paź, 16:14, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> Hi duro,
>
> On Sun, Oct 17, 2010 at 1:02 AM, duro <hereweg...@gmail.com> 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 sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to