2016-06-12 09:13:00 UTC+2, Sayantan Koley:

I'm writing square and multiply algorithm.
> but i need to store binary digits in sage.
> how to do?
>

Here is a way to get the binary digits of an integer.

    sage: a = 41

    sage: a.bits()
    [1, 0, 0, 1, 0, 1]

You can also have a look at the SageMath tutorials
to learn about lists, tuples and other array-like
structures in Sage.

http://doc.sagemath.org/html/en/tutorial/programming.html

I also recommend the thematic tutorials at

http://doc.sagemath.org/html/en/thematic_tutorials/index.html

especially the "Introduction to Python" ones.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to