Hi Pascal,

On 2013-03-16, pascal <[email protected]> wrote:
> How to perform base conversion with Sage ? Remember that Python has limited 
> capability to convert to an arbitrary base. For instance, Python, by 
> default, doesn't allow to convert to base 6. According to 
>
> https://groups.google.com/forum/?hl=fr&fromgroups=#!newtopic/sage-support/sage-support/82CzhLK1NnE
>
> Sage can perform conversion to (say) base 6 :
>
>
> sage: 2013.str(6)
> '13153'
> sage: int(_, 6)  
> 2013

Does the "digits()" method do what you want?

  sage: a=23412341234
  sage: a.digits(5)
  [4, 1, 4, 4, 0, 4, 4, 2, 0, 2, 2, 4, 0, 4, 3]

Do
  sage: a.digits?
to read the documentation.

Best regards,
Simon

-- 
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 http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to