This can currently be done by

sage: a = ZZ("sage",base=32); a
928270
sage: a.str(base=32)
'sage'
sage: a.str(base=36)
'jw9a'

For bases outside of 2..36, you can work with lists:

sage: b = ZZ([4,1,7],base=100)
sage: b
70104
sage: b.digits(base=71)
[27, 64, 13]
sage: 27 + 64*71 + 13*71^2
70104

For a function that makes this functionality easier to access, I would
suggest sage/rings/arith.py.  If you want to modify this behavior in some
ways, then you should take a look at sage/rings/integer.pyx.
David

On Thu, Nov 11, 2010 at 01:25, Eviatar <eviatarb...@gmail.com> wrote:

> I coded a simple function to convert any base to another, and I want
> to submit it as a patch. Where in the source code could this fit?
>
> Thanks in advance.
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com<sage-devel%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to